aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Poller.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-01-13 20:01:05 +0000
committerMario <mario@mariovavti.com>2023-01-13 20:01:05 +0000
commit2805520d1bcb2640fc079d54f5f230f7b87d1f84 (patch)
tree43b3e5bb7c71522d04560015478765a7b763a5fe /Zotlabs/Daemon/Poller.php
parentf6d940606350eb8685c278af6d87f3a0b8c0f5e5 (diff)
parentfb7ca18820e7618325dded78a3c3a464dd01b391 (diff)
downloadvolse-hubzilla-8.0.tar.gz
volse-hubzilla-8.0.tar.bz2
volse-hubzilla-8.0.zip
Merge remote-tracking branch 'origin/8.0RC'8.0
Diffstat (limited to 'Zotlabs/Daemon/Poller.php')
-rw-r--r--Zotlabs/Daemon/Poller.php41
1 files changed, 30 insertions, 11 deletions
diff --git a/Zotlabs/Daemon/Poller.php b/Zotlabs/Daemon/Poller.php
index 88213a7c9..0fdc3da16 100644
--- a/Zotlabs/Daemon/Poller.php
+++ b/Zotlabs/Daemon/Poller.php
@@ -17,9 +17,12 @@ class Poller {
}
}
- $interval = intval(get_config('system', 'poll_interval'));
- if (!$interval)
+ $interval = get_config('queueworker', 'queue_interval', 500000);
+
+/*
+ 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';
@@ -32,6 +35,7 @@ class Poller {
// Create a lockfile. Needs two vars, but $x doesn't need to contain anything.
$x = '';
file_put_contents($lockfile, $x);
+*/
logger('poller: start');
@@ -93,13 +97,24 @@ class Poller {
$min = intval(get_config('system', 'minimum_feedcheck_minutes'));
if (!$min)
$min = 60;
+
+ if ($t !== $c) {
+ // if the last fetch failed only attempt fetch once a day
+ $min = 60 * 24;
+ }
+
$x = datetime_convert('UTC', 'UTC', "now - $min minutes");
- if ($c < $x) {
+
+ if ($t < $x) {
Master::Summon(['Onepoll', $contact['abook_id']]);
- if ($interval)
- @time_sleep_until(microtime(true) + (float)$interval);
+
+ if ($interval) {
+ usleep($interval);
+ }
}
+
continue;
+
}
if ($contact['xchan_network'] !== 'zot6')
@@ -158,9 +173,10 @@ class Poller {
continue;
Master::Summon(['Onepoll', $contact['abook_id']]);
- if ($interval)
- @time_sleep_until(microtime(true) + (float)$interval);
+ if ($interval) {
+ usleep($interval);
+ }
}
}
@@ -181,9 +197,12 @@ class Poller {
if ($rr['ud_last'] > NULL_DATE)
if ($rr['ud_last'] > datetime_convert('UTC', 'UTC', 'now - 1 day'))
continue;
+
Master::Summon(['Onedirsync', $rr['ud_id']]);
- if ($interval)
- @time_sleep_until(microtime(true) + (float)$interval);
+
+ if ($interval) {
+ usleep($interval);
+ }
}
}
}
@@ -191,9 +210,9 @@ class Poller {
set_config('system', 'lastpoll', datetime_convert());
//All done - clear the lockfile
-
+/*
@unlink($lockfile);
-
+*/
return;
}
}