aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-01-18 14:35:00 +0000
committerMario <mario@mariovavti.com>2021-01-18 14:35:00 +0000
commit8b93136773ab22784af7dae1f97a5da0e99158c7 (patch)
tree56a073b3a4faee6bf517779373ae5d321aa493e1
parentc7a82a6a84ff4bdb372ccfe16d3ec382b485e2de (diff)
downloadvolse-hubzilla-8b93136773ab22784af7dae1f97a5da0e99158c7.tar.gz
volse-hubzilla-8b93136773ab22784af7dae1f97a5da0e99158c7.tar.bz2
volse-hubzilla-8b93136773ab22784af7dae1f97a5da0e99158c7.zip
more cleanup daemon/queue
-rw-r--r--Zotlabs/Daemon/Queue.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/Zotlabs/Daemon/Queue.php b/Zotlabs/Daemon/Queue.php
index 4092da225..36bdcfe81 100644
--- a/Zotlabs/Daemon/Queue.php
+++ b/Zotlabs/Daemon/Queue.php
@@ -7,12 +7,12 @@ require_once('include/zot.php');
class Queue {
- static public function run($argc,$argv) {
+ static public function run($argc, $argv) {
require_once('include/items.php');
require_once('include/bbcode.php');
- if($argc > 1)
+ if ($argc > 1)
$queue_id = $argv[1];
else
$queue_id = EMPTY_STR;
@@ -25,9 +25,9 @@ class Queue {
$r = q("select outq_posturl from outq where outq_created < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('3 DAY')
);
- if($r) {
- foreach($r as $rr) {
- $h = parse_url($rr['outq_posturl']);
+ if ($r) {
+ foreach ($r as $rr) {
+ $h = parse_url($rr['outq_posturl']);
$desturl = $h['scheme'] . '://' . $h['host'] . (($h['port']) ? ':' . $h['port'] : '');
q("update site set site_dead = 1 where site_dead = 0 and site_url = '%s' and site_update < %s - INTERVAL %s",
dbesc($desturl),
@@ -40,7 +40,7 @@ class Queue {
db_utcnow(), db_quoteinterval('3 DAY')
);
- if($queue_id) {
+ if ($queue_id) {
$r = q("SELECT * FROM outq WHERE outq_hash = '%s' LIMIT 1",
dbesc($queue_id)
);
@@ -53,7 +53,7 @@ class Queue {
// so that we don't start off a thousand deliveries for a couple of dead hubs.
// The zot driver will deliver everything destined for a single hub once contact is made (*if* contact is made).
// Other drivers will have to do something different here and may need their own query.
-
+
// Note: this requires some tweaking as new posts to long dead hubs once a day will keep them in the
// "every 15 minutes" category. We probably need to prioritise them when inserted into the queue
// or just prior to this query based on recent and long-term delivery history. If we have good reason to believe
@@ -66,7 +66,7 @@ class Queue {
db_utcnow()
);
while ($r) {
- foreach($r as $rv) {
+ foreach ($r as $rv) {
queue_deliver($rv);
}
$r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1",
@@ -74,10 +74,10 @@ class Queue {
);
}
}
- if(! $r)
+ if (!$r)
return;
- foreach($r as $rv) {
+ foreach ($r as $rv) {
queue_deliver($rv);
}
}