From d722d31776d387e40a29668b0465afb195165d75 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 21 May 2015 03:36:41 +0200 Subject: [PATCH] Some improvements ... MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- contrib/exp/exp2.php | 2 +- inc/classes/main/handler/tasks/class_TaskHandler.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/exp/exp2.php b/contrib/exp/exp2.php index 03b7108a..b6040fc5 100644 --- a/contrib/exp/exp2.php +++ b/contrib/exp/exp2.php @@ -5,7 +5,7 @@ bcscale(20); $balance = 1; $years = 100; -$rate = 0.05; +$rate = 0.02; $totalMonths = $years * 12; diff --git a/inc/classes/main/handler/tasks/class_TaskHandler.php b/inc/classes/main/handler/tasks/class_TaskHandler.php index 9fd650a6..1f958134 100644 --- a/inc/classes/main/handler/tasks/class_TaskHandler.php +++ b/inc/classes/main/handler/tasks/class_TaskHandler.php @@ -114,8 +114,11 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { // Get time difference from interval delay $diff = ($this->getMilliTime() - $currentTask['task_last_activity']) * 1000; + // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task ' . $currentTask['id'] . ' diff=' . $diff . ',task_interval_delay=' . $currentTask['task_interval_delay'] . ',task_max_runs=' . $currentTask['task_max_runs'] . ',task_total_runs=' . $currentTask['task_total_runs']); + // Is the interval delay reached? - if ((($diff < $currentTask['task_interval_delay']) && ($currentTask['task_max_runs'] == 0)) || (($currentTask['task_total_runs'] == $currentTask['task_max_runs']) && ($currentTask['task_max_runs'] > 0))) { + if ((($diff < $currentTask['task_interval_delay']) && ($currentTask['task_max_runs'] == 0)) || (($currentTask['task_max_runs'] > 0) && ($currentTask['task_total_runs'] == $currentTask['task_max_runs']))) { // Should we update the task from startup? if ($updateTask === TRUE) { // Update the task before leaving -- 2.39.5