Skip to content

Commit

Permalink
feat(NODE-6390): Add timeoutMS support to auto encryption (#4265)
Browse files Browse the repository at this point in the history
Co-authored-by: Warren James <warren.james@mongodb.com>
Co-authored-by: Neal Beeken <neal.beeken@mongodb.com>
Co-authored-by: Bailey Pearson <bailey.pearson@mongodb.com>
  • Loading branch information
4 people authored and dariakp committed Nov 6, 2024
1 parent b48b7af commit 55e08e7
Show file tree
Hide file tree
Showing 6 changed files with 491 additions and 20 deletions.
8 changes: 6 additions & 2 deletions src/client-side-encryption/auto_encrypter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export class AutoEncrypter {
socketOptions: autoSelectSocketOptions(this._client.options)
});

return deserialize(await stateMachine.execute(this, context), {
return deserialize(await stateMachine.execute(this, context, options.timeoutContext), {
promoteValues: false,
promoteLongs: false
});
Expand All @@ -416,7 +416,11 @@ export class AutoEncrypter {
socketOptions: autoSelectSocketOptions(this._client.options)
});

return await stateMachine.execute(this, context);
return await stateMachine.execute(
this,
context,
options.timeoutContext?.csotEnabled() ? options.timeoutContext : undefined
);
}

/**
Expand Down
Loading

0 comments on commit 55e08e7

Please sign in to comment.