aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Cron_daily.php
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-11-25 14:16:07 +0100
committerMax Kostikov <max@kostikov.co>2019-11-25 14:16:07 +0100
commit5c47c9ed9579dc97e0a508045fe50264bb96490b (patch)
treeabd67d04717eae22574b67f74abbf52b23d6b5a7 /Zotlabs/Daemon/Cron_daily.php
parentf6f7e7e8d2a9045ac2010ab2308ef7bc5e896efa (diff)
downloadvolse-hubzilla-5c47c9ed9579dc97e0a508045fe50264bb96490b.tar.gz
volse-hubzilla-5c47c9ed9579dc97e0a508045fe50264bb96490b.tar.bz2
volse-hubzilla-5c47c9ed9579dc97e0a508045fe50264bb96490b.zip
Add daily cached embedded content cleanup
Diffstat (limited to 'Zotlabs/Daemon/Cron_daily.php')
-rw-r--r--Zotlabs/Daemon/Cron_daily.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Cron_daily.php b/Zotlabs/Daemon/Cron_daily.php
index b41625963..affb706a0 100644
--- a/Zotlabs/Daemon/Cron_daily.php
+++ b/Zotlabs/Daemon/Cron_daily.php
@@ -94,6 +94,12 @@ class Cron_daily {
z6_discover();
call_hooks('cron_daily',datetime_convert());
+
+ // Clean up emdeded contect cache
+ q("DELETE FROM cache WHERE updated < %s - INTERVAL %s",
+ db_utcnow(),
+ db_quoteinterval(get_config('system','active_expire_days', '30') . ' DAY')
+ );
set_config('system','last_expire_day',intval(datetime_convert('UTC','UTC','now','d')));