diff options
author | zottel <github@zottel.net> | 2015-09-29 12:40:24 +0200 |
---|---|---|
committer | zottel <github@zottel.net> | 2015-09-29 12:40:24 +0200 |
commit | f950d27b3debfe08e022a477dbfb4fac101106e4 (patch) | |
tree | 38f62f0828163715c634e17290e2d77eb29d1b32 /include/queue.php | |
parent | 8e410f14b1b5b23e4c7e41d4902ac7b9cb529c1b (diff) | |
parent | 2a2da48d1871f408232a8397632f06528c8b43ae (diff) | |
download | volse-hubzilla-f950d27b3debfe08e022a477dbfb4fac101106e4.tar.gz volse-hubzilla-f950d27b3debfe08e022a477dbfb4fac101106e4.tar.bz2 volse-hubzilla-f950d27b3debfe08e022a477dbfb4fac101106e4.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/queue.php')
-rw-r--r-- | include/queue.php | 16 |
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') ); |