From e3a19469eb6940249ad87662399d14dbf2a79847 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 12 Dec 2022 09:03:49 +0000 Subject: bring back poll and delivery interval --- include/hubloc.php | 10 ++++++---- include/network.php | 10 +++++----- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/hubloc.php b/include/hubloc.php index 016d82f23..edd452dd3 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -155,8 +155,8 @@ function remove_obsolete_hublocs() { logger('remove_obsolete_hublocs: removing ' . count($r) . ' hublocs.'); - //$interval = ((get_config('system', 'delivery_interval') !== false) - //? intval(get_config('system', 'delivery_interval')) : 2 ); + $interval = ((get_config('system', 'delivery_interval') !== false) + ? intval(get_config('system', 'delivery_interval')) : 2 ); foreach($r as $rr) { q("update hubloc set hubloc_deleted = 1 where hubloc_id = %d", @@ -168,8 +168,10 @@ function remove_obsolete_hublocs() { ); if($x) { Master::Summon(array('Notifier', 'refresh_all', $x[0]['channel_id'])); - //if($interval) - //@time_sleep_until(microtime(true) + (float) $interval); + + if($interval) { + @time_sleep_until(microtime(true) + (float) $interval); + } } } } diff --git a/include/network.php b/include/network.php index 7deffe06c..52c21d808 100644 --- a/include/network.php +++ b/include/network.php @@ -1476,12 +1476,12 @@ function do_delivery($deliveries, $force = false) { } return; } - + */ $interval = ((get_config('system','delivery_interval') !== false) ? intval(get_config('system','delivery_interval')) : 2 ); - */ + $deliveries_per_process = intval(get_config('system','delivery_batch_count')); @@ -1500,10 +1500,10 @@ function do_delivery($deliveries, $force = false) { if(count($deliver) >= $deliveries_per_process) { Zotlabs\Daemon\Master::Summon(['Deliver', $deliver]); $deliver = []; - /* - if($interval) + + if($interval) { @time_sleep_until(microtime(true) + (float) $interval); - */ + } } } -- cgit v1.2.3