Skip to content

Commit 64ef3fd

Browse files
committed
add timeout to find.execute
1 parent a037c5d commit 64ef3fd

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/admin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ export class Admin {
7878
new RunAdminCommandOperation(command, {
7979
...resolveBSONOptions(options),
8080
session: options?.session,
81-
readPreference: options?.readPreference
81+
readPreference: options?.readPreference,
82+
timeoutMS: options?.timeoutMS
8283
})
8384
);
8485
}

src/db.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ export class Db {
272272
this.client,
273273
new RunCommandOperation(this, command, {
274274
...resolveBSONOptions(options),
275+
timeoutMS: options?.timeoutMS,
275276
session: options?.session,
276277
readPreference: options?.readPreference
277278
})

src/sdam/topology.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
583583
}
584584

585585
const { promise: serverPromise, resolve, reject } = promiseWithResolvers<Server>();
586+
console.log(options.timeout?.remainingTime, options.serverSelectionTimeoutMS);
586587
const timeout = options.timeout
587588
? Timeout.expires(
588589
Timeout.min(options.timeout.remainingTime, options.serverSelectionTimeoutMS ?? 0)

0 commit comments

Comments
 (0)