From 135382c668714583256a1775f38943d8222e3eb6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 13 Aug 2018 15:34:46 +0200 Subject: [PATCH] fix somehow created async-job with a next time before the keep time eg. not updated alarm trigger time in the past --- api/src/Asyncservice.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/src/Asyncservice.php b/api/src/Asyncservice.php index abfc9a167b..eef351fa3a 100644 --- a/api/src/Asyncservice.php +++ b/api/src/Asyncservice.php @@ -475,6 +475,13 @@ class Asyncservice error_log(__METHOD__."() finally deleting job ".array2string($job)); $this->delete($job['id']); } + // fix somehow created async-job with a next time before the keep time, eg. not updated alarm trigger time in the past + if ($job['next'] < $job['data']['keep_time']) + { + $job['next'] = $job['data']['keep_time']; + if ($this->debug) error_log(__METHOD__."() setting next to keep_time (".date('Y-m-d H:i:s', $job['data']['keep_time']).') for job '.array2string($job)); + $this->write($job, True); + } if ($this->debug) error_log(__METHOD__."() keeping job ".array2string($job)); continue; }