From 611c38b3e36fdd7fa77a090e2d3f0a1215d849a4 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 14 Dec 2017 16:38:51 +0000 Subject: [PATCH] The daemon now works fine --- scripts/daemon.php | 32 +++++++++++++++++++++++++++++--- scripts/dbstructure.php | 1 + scripts/worker.php | 14 ++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) mode change 100644 => 100755 scripts/daemon.php mode change 100644 => 100755 scripts/dbstructure.php mode change 100644 => 100755 scripts/worker.php diff --git a/scripts/daemon.php b/scripts/daemon.php old mode 100644 new mode 100755 index 76668adb16..a9b8d1d262 --- a/scripts/daemon.php +++ b/scripts/daemon.php @@ -1,6 +1,7 @@ +#!/usr/bin/env php set_baseurl(Config::get('system', 'url')); load_hooks(); +$spawn = (($_SERVER["argc"] <= 1) || ($_SERVER["argv"][1] == "spawn")); + +if ($spawn) { + Worker::spawnWorker(); + killme(); +} + $run_cron = (($_SERVER["argc"] <= 1) || ($_SERVER["argv"][1] != "no_cron")); + Worker::processQueue($run_cron); Worker::unclaimProcess(); -- 2.39.5