MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / startInflightCleanup

Function startInflightCleanup

src/auth.js:881–893  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

879const INFLIGHT_STALE_MS = 120_000;
880let _inflightCleanupTimer = null;
881function startInflightCleanup() {
882 if (_inflightCleanupTimer) return;
883 _inflightCleanupTimer = setInterval(() => {
884 const now = Date.now();
885 for (const a of accounts) {
886 if ((a._inflight || 0) > 0 && a._inflightAt && (now - a._inflightAt) > INFLIGHT_STALE_MS) {
887 log.warn(`Account ${safeAccountRef(a)} inflight=${a._inflight} stale >${Math.round((now - a._inflightAt) / 1000)}s, auto-resetting`);
888 a._inflight = 0;
889 a._inflightAt = 0;
890 }
891 }
892 }, 60_000).unref();
893}
894
895/**
896 * Try to re-check-out a specific account by apiKey, applying the same

Callers 1

initAuthFunction · 0.85

Calls 1

safeAccountRefFunction · 0.90

Tested by

no test coverage detected