Skip to content

Commit

Permalink
feat(NODE-5682): set maxTimeMS on commands and preempt I/O (#4174)
Browse files Browse the repository at this point in the history
Co-authored-by: Warren James <[email protected]>
  • Loading branch information
nbbeeken and W-A-James committed Oct 1, 2024
1 parent a69eba7 commit 72ccc6a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cmap/wire_protocol/on_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ export function onData(
// Adding event handlers
emitter.on('data', eventHandler);
emitter.on('error', errorHandler);
// eslint-disable-next-line github/no-then
timeoutContext?.timeoutForSocketRead?.then(undefined, errorHandler);

const timeoutForSocketRead = timeoutContext?.timeoutForSocketRead;
timeoutForSocketRead?.throwIfExpired();
Expand Down

0 comments on commit 72ccc6a

Please sign in to comment.