Run on launch

This commit is contained in:
Alan Grainger
2025-08-07 11:41:26 +02:00
parent ff77a01800
commit 81a4efb81a
+7 -2
View File
@@ -22,6 +22,7 @@ async function main () {
}
}
}
console.log('Waiting for next scheduled task...')
}
// Send the correct process error code for any uncaught exceptions
@@ -39,5 +40,9 @@ process.on('SIGTERM', () => {
process.exit(0)
})
cron.schedule(pta.config.schedule || '0,30 * * * *', main)
console.log('Waiting for next scheduled task...')
// Run on startup
main()
.then(() => {
// Then afterwards run on a schedule
cron.schedule(pta.config.schedule || '0,30 * * * *', main)
})