Files
Convivo/apps/sidecar/src/sessionize-poller.js
T
Lago c0fbf495dc feat: sync GridSmart agendas and use event-relative demo time
Support script and URL sources, automatic Sessionize polling, staff-linked service sessions, chronological agenda blocks, and inline Placeholders. Fix demo mode to use the active event date and document deployed behavior with regression coverage.
2026-10-11 08:39:15 +02:00

21 lines
561 B
JavaScript

function createSessionizePoller({ listEvents, syncEvent, isBusy, onError }) {
let polling = false;
return async function pollSessionize() {
if (polling || isBusy()) return;
polling = true;
try {
const events = await listEvents();
for (const event of events) {
if (isBusy()) break;
try { await syncEvent(event.id); }
catch (error) { onError(error, event.id); }
}
} catch (error) {
onError(error);
} finally {
polling = false;
}
};
}
module.exports = { createSessionizePoller };