From f9014d9e83c58927e66225ac730667db33ddf0c6 Mon Sep 17 00:00:00 2001 From: Luca Tacconi Date: Mon, 25 Oct 2021 18:51:43 +0200 Subject: [PATCH] Fix stat calc on HFT. Closes #18 --- routes/api/task-stat.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/routes/api/task-stat.php b/routes/api/task-stat.php index 89177ca..9e813b4 100644 --- a/routes/api/task-stat.php +++ b/routes/api/task-stat.php @@ -328,13 +328,12 @@ static function (array $file) { if($high_frequency){ - $nincrement++; - do{ + if(empty($calc_run_ref)){ - $calc_run_ref = $event_interval_from_orig; + $calc_run_ref = $calc_run_ref = $cron->getNextRunDate($event_interval_from_orig, 0, true)->format('Y-m-d H:i'); }else{ - $calc_run_ref = $cron->getNextRunDate($calc_run_ref, $nincrement, true)->format('Y-m-d H:i'); + $calc_run_ref = $cron->getNextRunDate($calc_run_ref, 1, true)->format('Y-m-d H:i'); } if($calc_run_ref <= $event_interval_to){