Skip to content

Commit

Permalink
fix socketTimeout connection instability
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkiesky committed Oct 8, 2024
1 parent 128c428 commit e0c2d09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/DataHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ export default class DataHandler {
},
});

redis.stream.on("data", (data) => {
redis.stream.prependListener("data", (data) => {
parser.execute(data);
});

// `prependListener` not switching a stream to flowing mode as `on` does,
// so we need to do it manually in case if our listener is the first one
redis.stream.resume();
}

private returnFatalError(err: Error) {
Expand Down

0 comments on commit e0c2d09

Please sign in to comment.