From 3ab52a060b154cba285af0f076ee7bef042b6edd Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 25 Mar 2026 07:54:51 +0000 Subject: [PATCH] add sleep intervals when adding worker tasks in a loop in Activity::init_background_fetch() (cherry picked from commit 955ee217e30e12dec86bdcd936ce10abc3ed366a) Co-authored-by: Mario --- Zotlabs/Lib/Activity.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 62ec2cf9f..4a1a518a8 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -3782,6 +3782,9 @@ class Activity { */ public static function init_background_fetch(string $observer_hash = '') { + + $interval = Config::Get('queueworker', 'queue_interval', 500000); + if (isset(App::$cache['zot_fetch_objects'])) { foreach (App::$cache['zot_fetch_objects'] as $mid => $info) { $force = $info['force']; @@ -3795,6 +3798,10 @@ class Activity { } Master::Summon(['Zotconvo', $channels_str, $mid, $force]); + + if ($interval) { + usleep($interval); + } } } @@ -3816,6 +3823,10 @@ class Activity { } Master::Summon(['Fetchparents', $channels_str, $observer_hash, $mid, $force]); + + if ($interval) { + usleep($interval); + } } } @@ -3832,6 +3843,10 @@ class Activity { } Master::Summon(['Convo', $channels_str, $observer_hash, $mid, $force]); + + if ($interval) { + usleep($interval); + } } }