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

Method _resume

src/change_stream.ts:1075–1090  ·  view source on GitHub ↗
(changeStreamError: AnyError)

Source from the content-addressed store, hash-verified

1073 }
1074
1075 private async _resume(changeStreamError: AnyError) {
1076 this.timeoutContext?.refresh();
1077 const topology = getTopology(this.parent);
1078 try {
1079 await topology.selectServer(this.cursor.readPreference, {
1080 operationName: 'reconnect topology in change stream',
1081 timeoutContext: this.timeoutContext,
1082 deprioritizedServers: new DeprioritizedServers()
1083 });
1084 this.cursor = this._createChangeStreamCursor(this.cursor.resumeOptions);
1085 } catch {
1086 // if the topology can't reconnect, close the stream
1087 await this.close();
1088 throw changeStreamError;
1089 }
1090 }
1091}
1092
1093/**

Callers 2

Calls 5

closeMethod · 0.95
getTopologyFunction · 0.90
selectServerMethod · 0.80
refreshMethod · 0.45

Tested by

no test coverage detected