aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Cron_weekly.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-12 21:36:25 -0800
committerzotlabs <mike@macgirvin.com>2017-11-12 21:37:06 -0800
commitb12dc89bb1fbdc29f82fffee3587360d618ef603 (patch)
tree40ab4897aa583dcf2627b6d139f4facaa99ac547 /Zotlabs/Daemon/Cron_weekly.php
parenta387868540e931a77e0af9ce706047f40feef021 (diff)
downloadvolse-hubzilla-b12dc89bb1fbdc29f82fffee3587360d618ef603.tar.gz
volse-hubzilla-b12dc89bb1fbdc29f82fffee3587360d618ef603.tar.bz2
volse-hubzilla-b12dc89bb1fbdc29f82fffee3587360d618ef603.zip
improve removed_channel final cleanup. Hubzilla issue #386
Diffstat (limited to 'Zotlabs/Daemon/Cron_weekly.php')
-rw-r--r--Zotlabs/Daemon/Cron_weekly.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Cron_weekly.php b/Zotlabs/Daemon/Cron_weekly.php
index 5b185f475..d44400767 100644
--- a/Zotlabs/Daemon/Cron_weekly.php
+++ b/Zotlabs/Daemon/Cron_weekly.php
@@ -21,6 +21,21 @@ class Cron_weekly {
mark_orphan_hubsxchans();
+ // Find channels that were removed in the last three weeks, but
+ // haven't been finally cleaned up. These should be older than 10
+ // days to ensure that "purgeall" messages have gone out or bounced
+ // or timed out.
+
+ $r = q("select channel_id from channel where channel_removed = 1 and
+ channel_deleted > %s - INTERVAL %s and channel_deleted < %s - INTERVAL %s",
+ db_utcnow(), db_quoteinterval('21 DAY'),
+ db_utcnow(), db_quoteinterval('10 DAY')
+ );
+ if($r) {
+ foreach($r as $rv) {
+ channel_remove_final($rv['channel_id']);
+ }
+ }
// get rid of really old poco records