mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 15:24:55 +00:00
19 lines
435 B
TypeScript
19 lines
435 B
TypeScript
import app from 'CommonServer/utils/StartServer';
|
|
import cron from 'node-cron';
|
|
import main from './workers/main';
|
|
|
|
// API
|
|
|
|
import ScriptAPI from './api/script';
|
|
|
|
app.use('/script', ScriptAPI);
|
|
|
|
const cronMinuteStartTime: $TSFixMe = Math.floor(Math.random() * 50);
|
|
|
|
// Script monitor cron job
|
|
cron.schedule('* * * * *', () => {
|
|
setTimeout(() => {
|
|
return main.runScriptMonitorsJob();
|
|
}, cronMinuteStartTime * 1000);
|
|
});
|