Skip to content

Commit 2df03bc

Browse files
author
Marius Burkard
committed
- don't treat cron jobs as running when last run is older than 24h
1 parent 2b3eb82 commit 2df03bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/lib/classes/cronjob.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected function onPrepare() {
100100
// check the run time and values for this job
101101

102102
// get previous run data
103-
$data = $app->db->queryOneRecord("SELECT `last_run`, `next_run`, `running` FROM `sys_cron` WHERE `name` = ?", get_class($this));
103+
$data = $app->db->queryOneRecord("SELECT `last_run`, `next_run`, IF(`last_run` IS NOT NULL AND `last_run` < DATE_SUB(NOW(), INTERVAL 24 HOUR), 0, `running`) as `running` FROM `sys_cron` WHERE `name` = ?", get_class($this));
104104
if($data) {
105105
if($data['last_run']) $this->_last_run = $data['last_run'];
106106
if($data['next_run']) $this->_next_run = $data['next_run'];

0 commit comments

Comments
 (0)