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

Method _poll

src/sdam/srv_polling.ts:114–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112 }
113
114 async _poll(): Promise<void> {
115 const generation = this.generation;
116 let srvRecords;
117
118 try {
119 srvRecords = await dns.promises.resolve(this.srvAddress, 'SRV');
120 } catch {
121 this.failure();
122 return;
123 }
124
125 if (generation !== this.generation) {
126 return;
127 }
128
129 const finalAddresses: dns.SrvRecord[] = [];
130 for (const record of srvRecords) {
131 try {
132 checkParentDomainMatch(record.name, this.srvHost);
133 finalAddresses.push(record);
134 } catch (error) {
135 squashError(error);
136 }
137 }
138
139 if (!finalAddresses.length) {
140 this.failure();
141 return;
142 }
143
144 this.success(finalAddresses);
145 }
146}

Callers 2

scheduleMethod · 0.95

Calls 5

failureMethod · 0.95
successMethod · 0.95
checkParentDomainMatchFunction · 0.90
squashErrorFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected