This commit is contained in:
Henry Jameson 2026-01-14 15:14:14 +02:00
commit f775f64034
2 changed files with 15 additions and 2 deletions

View file

@ -5,7 +5,10 @@ const userBearer = process.env.USER_BEARER;
const instance = process.env.INSTANCE;
const videoId = process.env.VIDEO_ID;
const globalState = { currentlyLive: false };
const globalState = {
exit: false,
currentlyLive: false,
};
const headers = (bearer) => ({
accept: '*/*',
@ -55,6 +58,7 @@ const scrobble = ({ title, external_link }) =>
// });
process.on('SIGINT', () => {
globalState.exit = true;
process.exit();
});
@ -90,7 +94,7 @@ const loop = async () => {
}
}
setTimeout(loop, 30 * 1000);
if (!globalState.exit) setTimeout(loop, 30 * 1000);
};
loop();