aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r--Zotlabs/Daemon/Addon.php14
-rw-r--r--Zotlabs/Daemon/Checksites.php1
-rw-r--r--Zotlabs/Daemon/Cron_daily.php1
-rw-r--r--Zotlabs/Daemon/Cron_weekly.php1
-rw-r--r--Zotlabs/Daemon/Queue.php23
5 files changed, 18 insertions, 22 deletions
diff --git a/Zotlabs/Daemon/Addon.php b/Zotlabs/Daemon/Addon.php
new file mode 100644
index 000000000..c2889e596
--- /dev/null
+++ b/Zotlabs/Daemon/Addon.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace Zotlabs\Daemon;
+
+require_once('include/zot.php');
+
+class Addon {
+
+ static public function run($argc,$argv) {
+
+ call_hooks('daemon_addon',$argv);
+
+ }
+}
diff --git a/Zotlabs/Daemon/Checksites.php b/Zotlabs/Daemon/Checksites.php
index 991456319..a2081967a 100644
--- a/Zotlabs/Daemon/Checksites.php
+++ b/Zotlabs/Daemon/Checksites.php
@@ -3,7 +3,6 @@
namespace Zotlabs\Daemon;
require_once('include/zot.php');
-require_once('include/hubloc.php');
class Checksites {
diff --git a/Zotlabs/Daemon/Cron_daily.php b/Zotlabs/Daemon/Cron_daily.php
index a16d49853..0f0001890 100644
--- a/Zotlabs/Daemon/Cron_daily.php
+++ b/Zotlabs/Daemon/Cron_daily.php
@@ -76,7 +76,6 @@ class Cron_daily {
Master::Summon(array('Expire'));
Master::Summon(array('Cli_suggest'));
- require_once('include/hubloc.php');
remove_obsolete_hublocs();
call_hooks('cron_daily',datetime_convert());
diff --git a/Zotlabs/Daemon/Cron_weekly.php b/Zotlabs/Daemon/Cron_weekly.php
index ba4b67ff5..5b185f475 100644
--- a/Zotlabs/Daemon/Cron_weekly.php
+++ b/Zotlabs/Daemon/Cron_weekly.php
@@ -17,7 +17,6 @@ class Cron_weekly {
z_check_cert();
- require_once('include/hubloc.php');
prune_hub_reinstalls();
mark_orphan_hubsxchans();
diff --git a/Zotlabs/Daemon/Queue.php b/Zotlabs/Daemon/Queue.php
index 27306589d..11cbe4494 100644
--- a/Zotlabs/Daemon/Queue.php
+++ b/Zotlabs/Daemon/Queue.php
@@ -61,30 +61,15 @@ class Queue {
// the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once
// or twice a day.
- // FIXME: can we sort postgres on outq_priority and maintain the 'distinct' ?
- // The order by max(outq_priority) might be a dodgy query because of the group by.
- // The desired result is to return a sequence in the order most likely to be delivered in this run.
- // If a hub has already been sitting in the queue for a few days, they should be delivered last;
- // hence every failure should drop them further down the priority list.
-
- if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
- $prefix = 'DISTINCT ON (outq_posturl)';
- $suffix = 'ORDER BY outq_posturl';
- } else {
- $prefix = '';
- $suffix = 'GROUP BY outq_posturl ORDER BY max(outq_priority)';
- }
- $r = q("SELECT $prefix * FROM outq WHERE outq_delivered = 0 and (( outq_created > %s - INTERVAL %s and outq_updated < %s - INTERVAL %s ) OR ( outq_updated < %s - INTERVAL %s )) $suffix",
- db_utcnow(), db_quoteinterval('12 HOUR'),
- db_utcnow(), db_quoteinterval('15 MINUTE'),
- db_utcnow(), db_quoteinterval('1 HOUR')
+ $r = q("SELECT * FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s ",
+ db_utcnow()
);
}
if(! $r)
return;
- foreach($r as $rr) {
- queue_deliver($rr);
+ foreach($r as $rv) {
+ queue_deliver($rv);
}
}
}