diff options
author | mrjive <mrjive@mrjive.it> | 2015-09-29 08:01:51 +0200 |
---|---|---|
committer | mrjive <mrjive@mrjive.it> | 2015-09-29 08:01:51 +0200 |
commit | 11c1573b55f278a664a90a2872d06a40b3ac3026 (patch) | |
tree | 4061879d490fec39ab01d3feeb575b86586fb7f8 /include/queue.php | |
parent | 006ca4421a7027ccee4612beb99a1f9976146070 (diff) | |
parent | b3525b865784ff5d2d5a76b913b8c86d139cc0f3 (diff) | |
download | volse-hubzilla-11c1573b55f278a664a90a2872d06a40b3ac3026.tar.gz volse-hubzilla-11c1573b55f278a664a90a2872d06a40b3ac3026.tar.bz2 volse-hubzilla-11c1573b55f278a664a90a2872d06a40b3ac3026.zip |
Merge pull request #5 from redmatrix/master
updating from original codebase
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') ); |