X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/5aa92645bf876259fa327cf89a23df1f7034b1e3..14452b9930953c2692a7281978d90beabd8d010e:/cron.php 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'];