initialize
This commit is contained in:
commit
99b6232436
24 changed files with 3872 additions and 0 deletions
31
plugins/heartbeat.js
Normal file
31
plugins/heartbeat.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// continue;
|
||||
|
||||
const heartbeatApiInfo = {
|
||||
version: 1,
|
||||
changelogs: [
|
||||
"17/4/25, create endpoint map @Pakin"
|
||||
],
|
||||
|
||||
};
|
||||
|
||||
|
||||
let heartbeatTask = CronJobs.doEveryMinute(() => {
|
||||
Log.debug("[hb] test heartbeat");
|
||||
Log.debug(`[hb] current running tasks: ${JSON.stringify(CronJobs.getAllRunning.size)}`);
|
||||
heartbeatTask.stop();
|
||||
}, 'heartbeat');
|
||||
|
||||
heartbeatTask.on('stop-heartbeat', () => heartbeatTask.stop());
|
||||
|
||||
cronTasks[0] = heartbeatTask;
|
||||
|
||||
endpointMap = {
|
||||
'': function(req, res, next){
|
||||
|
||||
res.locals.title = "heartbeat";
|
||||
res.locals.version = heartbeatApiInfo.version;
|
||||
res.locals.task_num = CronJobs.getAllRunning.size;
|
||||
|
||||
res.render("heartbeat");
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue