MCPcopy
hub / github.com/mongodb/node-mongodb-native / timeoutContextForKillCursors

Function timeoutContextForKillCursors

src/cursor/abstract_cursor.ts:990–1003  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

988 this.abortListener?.[kDispose]();
989 this.isClosed = true;
990 const timeoutContextForKillCursors = (): CursorTimeoutContext | undefined => {
991 if (timeoutMS != null) {
992 this.timeoutContext?.clear();
993 return new CursorTimeoutContext(
994 TimeoutContext.create({
995 serverSelectionTimeoutMS: this.client.s.options.serverSelectionTimeoutMS,
996 timeoutMS
997 }),
998 this
999 );
1000 } else {
1001 return this.timeoutContext?.refreshed();
1002 }
1003 };
1004
1005 const withEmitClose = async (fn: () => Promise<void>) => {
1006 try {

Callers 1

closeFunction · 0.85

Calls 2

clearMethod · 0.45
refreshedMethod · 0.45

Tested by

no test coverage detected