diff --git a/app/main/model/pathfinder/cronmodel.php b/app/main/model/pathfinder/cronmodel.php index 59475c614..3708f6cae 100644 --- a/app/main/model/pathfinder/cronmodel.php +++ b/app/main/model/pathfinder/cronmodel.php @@ -157,6 +157,10 @@ protected function logState(){ $this->lastExecMemPeak = null; } + /** + * @param bool $addLastIfFinished + * @return array + */ protected function getHistory(bool $addLastIfFinished = false) : array { $history = $this->history ? : []; @@ -214,6 +218,10 @@ protected function inExec() : bool { return $this->lastExecStart && !$this->lastExecEnd; } + /** + * @return bool + * @throws \Exception + */ protected function isTimedOut() : bool { $timedOut = false; if($this->lastExecStart){ diff --git a/js/app/lib/cron.js b/js/app/lib/cron.js index 3c1ef3042..3f7ef16ca 100644 --- a/js/app/lib/cron.js +++ b/js/app/lib/cron.js @@ -8,7 +8,7 @@ define([ Example1 run task every second ------------------------------------------------------------------------------------ let task1 = Cron.new('task1', {precision: 'seconds', interval: 1, timeout: 100}); task1.task = (timer) => { - console.log('task1 function():', timer.getTotalTimeValues()); + console.info('task1 function():', timer.getTotalTimeValues()); return 'OK'; }; Cron.set(task1); @@ -16,7 +16,7 @@ define([ Example2 run task every 3 seconds --------------------------------------------------------------------------------- let task1 = Cron.new('task1', {precision: 'seconds', interval: 3, timeout: 100}); task1.task = (timer) => { - console.log('task1 function():', timer.getTotalTimeValues()); + console.info('task1 function():', timer.getTotalTimeValues()); return 'OK'; }; Cron.set(task1); @@ -25,12 +25,12 @@ define([ let task1 = Cron.new('task1', {precision: 'seconds', interval: 1, timeout: 100}); task1.task = (timer, task) => { return new Promise((resolve, reject) => { - console.log('task1 Promise1():', timer.getTotalTimeValues(), task.get('interval')); + console.info('task1 Promise1():', timer.getTotalTimeValues(), task.get('interval')); //task.set('interval', task.get('interval') + 1) // increase run interval every time by 1s resolve('OK1'); }).then(payload => { return new Promise((resolve, reject) => { - console.log('task2 Promise2():', timer.getTotalTimeValues(), payload); + console.info('task2 Promise2():', timer.getTotalTimeValues(), payload); resolve('OK2'); }); }); diff --git a/public/js/v1.5.5/app/lib/cron.js b/public/js/v1.5.5/app/lib/cron.js index 3c1ef3042..3f7ef16ca 100644 --- a/public/js/v1.5.5/app/lib/cron.js +++ b/public/js/v1.5.5/app/lib/cron.js @@ -8,7 +8,7 @@ define([ Example1 run task every second ------------------------------------------------------------------------------------ let task1 = Cron.new('task1', {precision: 'seconds', interval: 1, timeout: 100}); task1.task = (timer) => { - console.log('task1 function():', timer.getTotalTimeValues()); + console.info('task1 function():', timer.getTotalTimeValues()); return 'OK'; }; Cron.set(task1); @@ -16,7 +16,7 @@ define([ Example2 run task every 3 seconds --------------------------------------------------------------------------------- let task1 = Cron.new('task1', {precision: 'seconds', interval: 3, timeout: 100}); task1.task = (timer) => { - console.log('task1 function():', timer.getTotalTimeValues()); + console.info('task1 function():', timer.getTotalTimeValues()); return 'OK'; }; Cron.set(task1); @@ -25,12 +25,12 @@ define([ let task1 = Cron.new('task1', {precision: 'seconds', interval: 1, timeout: 100}); task1.task = (timer, task) => { return new Promise((resolve, reject) => { - console.log('task1 Promise1():', timer.getTotalTimeValues(), task.get('interval')); + console.info('task1 Promise1():', timer.getTotalTimeValues(), task.get('interval')); //task.set('interval', task.get('interval') + 1) // increase run interval every time by 1s resolve('OK1'); }).then(payload => { return new Promise((resolve, reject) => { - console.log('task2 Promise2():', timer.getTotalTimeValues(), payload); + console.info('task2 Promise2():', timer.getTotalTimeValues(), payload); resolve('OK2'); }); }); diff --git a/public/templates/ui/info_panel.html b/public/templates/ui/info_panel.html index 61f6f5214..fecfd3961 100644 --- a/public/templates/ui/info_panel.html +++ b/public/templates/ui/info_panel.html @@ -1,4 +1,4 @@