Skip to content

Commit e0c2d09

Browse files
committed
fix socketTimeout connection instability
1 parent 128c428 commit e0c2d09

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/DataHandler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@ export default class DataHandler {
5656
},
5757
});
5858

59-
redis.stream.on("data", (data) => {
59+
redis.stream.prependListener("data", (data) => {
6060
parser.execute(data);
6161
});
62+
63+
// `prependListener` not switching a stream to flowing mode as `on` does,
64+
// so we need to do it manually in case if our listener is the first one
65+
redis.stream.resume();
6266
}
6367

6468
private returnFatalError(err: Error) {

0 commit comments

Comments
 (0)