diff options
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Libsync.php | 6 | ||||
-rw-r--r-- | Zotlabs/Lib/QueueWorker.php | 13 |
2 files changed, 8 insertions, 11 deletions
diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index 2d6d86d78..f844c63b5 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -135,9 +135,7 @@ class Libsync { $info['collection_members'] = $r; } - - $interval = ((get_config('system', 'delivery_interval') !== false) - ? intval(get_config('system', 'delivery_interval')) : 2); + $interval = get_config('queueworker', 'queue_interval', 500000); logger('Packet: ' . print_r($info, true), LOGGER_DATA, LOG_DEBUG); @@ -173,7 +171,7 @@ class Libsync { */ if ($interval) { - @time_sleep_until(microtime(true) + (float)$interval); + usleep($interval); } } diff --git a/Zotlabs/Lib/QueueWorker.php b/Zotlabs/Lib/QueueWorker.php index 9f60e3315..468383ae2 100644 --- a/Zotlabs/Lib/QueueWorker.php +++ b/Zotlabs/Lib/QueueWorker.php @@ -66,7 +66,7 @@ class QueueWorker { return; } - public static function Summon(&$argv) { + public static function Summon($argv) { if ($argv[0] !== 'Queueworker') { @@ -102,19 +102,18 @@ class QueueWorker { return; } self::qcommit(); - logger('INSERTED: ' . $workinfo_json, LOGGER_DEBUG); + hz_syslog('INSERTED: ' . $workinfo_json, LOGGER_DEBUG); } - $argv = []; $workers = self::GetWorkerCount(); if ($workers < self::$maxworkers) { - logger("Less than max active workers ($workers) max = " . self::$maxworkers . ".", LOGGER_DEBUG); + hz_syslog("Less than max active workers ($workers) max = " . self::$maxworkers . ".", LOGGER_DEBUG); $phpbin = get_config('system', 'phpbin', 'php'); proc_run($phpbin, 'Zotlabs/Daemon/Master.php', ['Queueworker']); } } - public static function Release(&$argv) { + public static function Release($argv) { if ($argv[0] !== 'Queueworker') { @@ -152,7 +151,7 @@ class QueueWorker { self::qcommit(); logger('INSERTED: ' . $workinfo_json, LOGGER_DEBUG); } - $argv = []; + self::Process(); } @@ -228,7 +227,7 @@ class QueueWorker { public static function Process() { if (!self::GetWorkerID()) { - logger('Unable to get worker ID. Exiting.', LOGGER_DEBUG); + hz_syslog('Unable to get worker ID. Exiting.', LOGGER_DEBUG); killme(); } |