diff --git a/module/cron/control.php b/module/cron/control.php index 60c9c7df97..4c67f336e2 100644 --- a/module/cron/control.php +++ b/module/cron/control.php @@ -155,6 +155,8 @@ class cron extends control $crons = $this->cron->getCrons('nostop'); $parsedCrons = $this->cron->parseCron($crons); + /* Update last time. */ + $this->cron->changeStatus(key($parsedCrons), 'normal', true); $this->cron->logCron("The cron process created.\n"); $this->loadModel('common'); $startedTime = time(); diff --git a/module/cron/model.php b/module/cron/model.php index 34a0de3f31..5a48bdfa58 100644 --- a/module/cron/model.php +++ b/module/cron/model.php @@ -84,6 +84,7 @@ class cronModel extends model } } + $this->dao->update(TABLE_CRON)->set('lastTime')->eq(date(DT_DATETIME1))->where('lastTime')->notZeroDate()->andWhere('status')->ne('stop')->exec(); return $parsedCrons; }