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 --- Zotlabs/Daemon/Cron.php | 20 ++++++++++---------- Zotlabs/Daemon/Poller.php | 24 +++++++++++------------- 2 files changed, 21 insertions(+), 23 deletions(-) (limited to 'Zotlabs/Daemon') diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index 9b8946e57..b8bcbe3a2 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -52,7 +52,7 @@ class Cron { require_once('include/account.php'); remove_expired_registrations(); - //$interval = get_config('system', 'delivery_interval', 3); + $interval = get_config('system', 'delivery_interval', 3); // expire any expired items @@ -67,10 +67,10 @@ class Cron { if ($rr['item_wall']) { // The notifier isn't normally invoked unless item_drop is interactive. Master::Summon(['Notifier', 'drop', $rr['id']]); - /* - if ($interval) + + if ($interval) { @time_sleep_until(microtime(true) + (float)$interval); - */ + } } } } @@ -100,10 +100,10 @@ class Cron { if ($r) { foreach ($r as $rr) { Master::Summon(array('Directory', $rr['channel_id'], 'force')); - /* - if ($interval) + + if ($interval) { @time_sleep_until(microtime(true) + (float)$interval); - */ + } } } @@ -157,10 +157,10 @@ class Cron { ); } Master::Summon(array('Notifier', 'wall-new', $rr['id'])); - /* - if ($interval) + + if ($interval) { @time_sleep_until(microtime(true) + (float)$interval); - */ + } } } } diff --git a/Zotlabs/Daemon/Poller.php b/Zotlabs/Daemon/Poller.php index 5bf8d3a02..b43b814f7 100644 --- a/Zotlabs/Daemon/Poller.php +++ b/Zotlabs/Daemon/Poller.php @@ -17,12 +17,13 @@ class Poller { } } -/* + $interval = intval(get_config('system', 'poll_interval')); - if (!$interval) + if (!$interval) { $interval = ((get_config('system', 'delivery_interval') === false) ? 3 : intval(get_config('system', 'delivery_interval'))); + } - +/* // Check for a lockfile. If it exists, but is over an hour old, it's stale. Ignore it. $lockfile = 'store/[data]/poller'; if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 3600)) @@ -106,10 +107,10 @@ class Poller { if ($t < $x) { Master::Summon(['Onepoll', $contact['abook_id']]); - /* - if ($interval) + + if ($interval) { @time_sleep_until(microtime(true) + (float)$interval); - */ + } } continue; @@ -173,11 +174,9 @@ class Poller { Master::Summon(['Onepoll', $contact['abook_id']]); - /* - if ($interval) + if ($interval) { @time_sleep_until(microtime(true) + (float)$interval); - */ - + } } } @@ -201,10 +200,9 @@ class Poller { Master::Summon(['Onedirsync', $rr['ud_id']]); - /* - if ($interval) + if ($interval) { @time_sleep_until(microtime(true) + (float)$interval); - */ + } } } } -- cgit v1.2.3