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.
21 lines
561 B
JavaScript
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 }; |