()
| 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 |
nothing calls this directly
no test coverage detected