Really huge mass update; Getting everything up-to-spec and implementing a wide range of features
This commit is contained in:
@@ -6,8 +6,8 @@ import { getAdminSettings } from "../lib/adminSettings";
|
||||
const log = createLogger("CRON");
|
||||
|
||||
export function startCronWorkers() {
|
||||
// Inactivity check every 30 minutes
|
||||
cron.schedule("*/30 * * * *", async () => {
|
||||
// Inactivity check every 5 minutes
|
||||
cron.schedule("*/5 * * * *", async () => {
|
||||
try {
|
||||
await checkInactivity();
|
||||
} catch (e) {
|
||||
@@ -24,6 +24,10 @@ export function startCronWorkers() {
|
||||
}
|
||||
});
|
||||
|
||||
// Run an inactivity check immediately on startup so previews that went idle
|
||||
// while PP was down aren't left waiting for the next scheduled tick.
|
||||
checkInactivity().catch((e) => log.error({ e }, "Startup inactivity check error"));
|
||||
|
||||
log.info("Cron workers started");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user