Files
shd.build/scripts/scheduler-client.mjs
jb dd84dff055
Validate and deploy production / validate (push) Successful in 23s
Validate and deploy staging / validate (push) Successful in 50s
Validate and deploy production / deploy (push) Failing after 40s
Validate and deploy staging / deploy (push) Failing after 7s
feat: add community publishing and news syndication
2026-08-01 21:42:09 -04:00

20 lines
652 B
JavaScript

const endpoint = process.env.SCHEDULER_URL;
const token = process.env.SCHEDULER_TOKEN;
if (!endpoint || !token)
throw new Error('SCHEDULER_URL and SCHEDULER_TOKEN are required.');
while (true) {
try {
const response = await fetch(endpoint, {
method: 'POST',
headers: { authorization: `Bearer ${token}` },
});
if (!response.ok)
throw new Error(`Scheduler endpoint returned HTTP ${response.status}.`);
console.log(`Scheduler tick: ${JSON.stringify(await response.json())}`);
} catch (error) {
console.error('Scheduler tick failed', error);
}
await new Promise((resolve) => setTimeout(resolve, 60_000));
}