From 14452b9930953c2692a7281978d90beabd8d010e Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 10 Sep 2016 23:08:58 +0000 Subject: [PATCH] Fixed double notifications, hopefully. --- WEB-INF/templates/footer.tpl | 2 +- cron.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 793494df..c9af24b2 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.30.3529 | Copyright © Anuko | +  Anuko Time Tracker 1.9.31.3530 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/cron.php b/cron.php index 345ddd3e..9212e558 100644 --- a/cron.php +++ b/cron.php @@ -46,6 +46,7 @@ import('ttReportHelper'); $mdb2 = getConnection(); $now = mktime(); +$now = 1473548400; $sql = "select * from tt_cron where $now >= next and status = 1 and report_id is not null and email is not null"; @@ -71,7 +72,8 @@ while ($val = $res->fetchRow()) { echo "Error while emailing report...
"; // Calculate next execution time. - $next = tdCron::getNextOccurrence($val['cron_spec'], $now); + $next = tdCron::getNextOccurrence($val['cron_spec'], $now + 60); // +60 sec is here to get us correct $next when $now is close to existing "next". + // This is because the accuracy of tdcron class appears to be 1 minute. // Update last and next values in tt_cron. $sql = "update tt_cron set last = $now, next = $next where id = ".$val['id']; -- 2.20.1