]> git.mxchange.org Git - friendica.git/commitdiff
Fix: Workerqueue processes had been killed too early
authorMichael <heluecht@pirati.ca>
Mon, 11 Feb 2019 22:39:59 +0000 (22:39 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 11 Feb 2019 22:39:59 +0000 (22:39 +0000)
src/Core/Worker.php

index 3b575850c682c6f1097230f1b6581b57d5bda92c..5deb33ab644f403f307d532a1d85048db96d82c5 100644 (file)
@@ -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);