MCPcopy
hub / github.com/graphql/graphql-spec / worker

Function worker

scripts/generate-contributor-list.mjs:260–282  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

258 let idx = 0;
259
260 async function worker() {
261 while (idx < pool.length) {
262 const i = idx++;
263 const { name, email } = pool[i];
264 const ekey = toLower(email);
265 if (emailToLogin.has(ekey)) continue;
266
267 let login = loginFromNoreply(email);
268 if (!login) login = await searchUsersByNameExact(name);
269 if (!login) {
270 const cands = candidateHandlesFromEmailAndName(email, name);
271 for (const cand of cands) {
272 const solo = await searchUsersByLoginToken(cand);
273 if (solo) { login = solo; break; }
274 }
275 }
276 if (!login && DEBUG) logd(`Unresolved: "${name}" <${email}>`);
277 emailToLogin.set(ekey, login || "");
278 if (login) loginBestName.set(login, pickBetterName(loginBestName.get(login) || "", name));
279
280 if (i % 10 === 0) await sleep(60);
281 }
282 }
283 await Promise.all(Array.from({ length: concurrency }, worker));
284
285 // 4) Build candidate rows (resolved only), fetch profile names

Callers

nothing calls this directly

Calls 8

toLowerFunction · 0.85
loginFromNoreplyFunction · 0.85
searchUsersByNameExactFunction · 0.85
searchUsersByLoginTokenFunction · 0.85
logdFunction · 0.85
pickBetterNameFunction · 0.85
sleepFunction · 0.85

Tested by

no test coverage detected