From 742b472994f39c7cab8579b622f26434ff614d10 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 11 Feb 2019 22:39:59 +0000 Subject: [PATCH] Fix: Workerqueue processes had been killed too early --- src/Core/Worker.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 3b575850c6..5deb33ab64 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -650,7 +650,8 @@ class Worker $argv[0] = basename($argv[0]); // How long is the process already running? - $duration = (time() - strtotime($entry["executed"])) / 60; + // For some weird reasons we cannot use "time()" here. It doesn't seem to be in UTC. + $duration = (strtotime(DateTimeFormat::utcNow()) - strtotime($entry["executed"])) / 60; if ($duration > $max_duration) { Logger::log("Worker process ".$entry["pid"]." (".substr(json_encode($argv), 0, 50).") took more than ".$max_duration." minutes. It will be killed now."); posix_kill($entry["pid"], SIGTERM);