MCPcopy Index your code
hub / github.com/stemdeckapp/stemdeck / startPolling

Function startPolling

static/mobile/app.js:635–644  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

633 if (extractPoll) { clearInterval(extractPoll); extractPoll = null; }
634
635 const startPolling = () => {
636 if (extractPoll) return;
637 extractPoll = setInterval(async () => {
638 try {
639 const r = await fetch(`/api/jobs/${jobId}`, { cache: "no-store" });
640 if (!r.ok) throw new Error(String(r.status));
641 if (_onExtractState(jobId, await r.json())) { clearInterval(extractPoll); extractPoll = null; }
642 } catch { /* keep polling */ }
643 }, 2500);
644 };
645
646 try {
647 const es = new EventSource(`/api/jobs/${jobId}/events`);

Callers 1

followExtractionFunction · 0.85

Calls 1

_onExtractStateFunction · 0.85

Tested by

no test coverage detected