From 68fc2a220e81589d86af0233b533b6b713545a24 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 19 Mar 2014 19:53:14 -0700 Subject: prune_hub_reinstalls() and add cron weekly as a side effect --- include/hubloc.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/hubloc.php (limited to 'include/hubloc.php') diff --git a/include/hubloc.php b/include/hubloc.php new file mode 100644 index 000000000..b6f0c8c57 --- /dev/null +++ b/include/hubloc.php @@ -0,0 +1,32 @@ + 1) { + + $d1 = datetime_convert('UTC','UTC',$x[0]['c']); + $d2 = datetime_convert('UTC','UTC','now - 3 days'); + + // allow some slop period, say 3 days - just in case this is a glitch or transient occurrence + + if($d1 < $d2) { + logger('prune_hub_reinstalls: removing dead hublocs at ' . $rr['site_url']); + $y = q("delete from hubloc where hubloc_sitekey = '%s'", + dbesc($x[0]['hubloc_sitekey']) + ); + } + } + } + } +} \ No newline at end of file -- cgit v1.2.3