aboutsummaryrefslogtreecommitdiffstats
path: root/include/queue.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-28 17:13:11 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-09-28 17:13:11 -0700
commite5f47cd14b9dd97385d93c2610e05d959e526ce8 (patch)
tree9863fff105662540bc6e18b8fac5dbb156e5d0f3 /include/queue.php
parentdbeae16dc142c3bc832718b0c29eefd6a82033d6 (diff)
downloadvolse-hubzilla-e5f47cd14b9dd97385d93c2610e05d959e526ce8.tar.gz
volse-hubzilla-e5f47cd14b9dd97385d93c2610e05d959e526ce8.tar.bz2
volse-hubzilla-e5f47cd14b9dd97385d93c2610e05d959e526ce8.zip
create site records for all queued sites and check for death
Diffstat (limited to 'include/queue.php')
-rw-r--r--include/queue.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/queue.php b/include/queue.php
index 7d2ad3b2d..18c8c5fa2 100644
--- a/include/queue.php
+++ b/include/queue.php
@@ -22,6 +22,22 @@ function queue_run($argv, $argc){
logger('queue: start');
+
+ $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) {
+ $site_url = '';
+ $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),
+ db_utcnow(), db_quoteinterval('1 MONTH')
+ );
+ }
+ }
+
$r = q("DELETE FROM outq WHERE outq_created < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('3 DAY')
);