aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Cache.php
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-11-25 21:50:02 +0100
committerMario <mario@mariovavti.com>2019-11-25 21:50:02 +0100
commit901785663edc7045c66d9393432a18bb376436bb (patch)
tree8e3c393a518656b1349e43205eed2554814c2924 /Zotlabs/Lib/Cache.php
parent38de059156f9a6ec63727d47a96d1b15e96e3b47 (diff)
downloadvolse-hubzilla-901785663edc7045c66d9393432a18bb376436bb.tar.gz
volse-hubzilla-901785663edc7045c66d9393432a18bb376436bb.tar.bz2
volse-hubzilla-901785663edc7045c66d9393432a18bb376436bb.zip
Fix once cached embedded content is used and stored forever
Diffstat (limited to 'Zotlabs/Lib/Cache.php')
-rw-r--r--Zotlabs/Lib/Cache.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/Zotlabs/Lib/Cache.php b/Zotlabs/Lib/Cache.php
index cea075659..878201a42 100644
--- a/Zotlabs/Lib/Cache.php
+++ b/Zotlabs/Lib/Cache.php
@@ -11,8 +11,10 @@ class Cache {
$hash = hash('whirlpool',$key);
- $r = q("SELECT v FROM cache WHERE k = '%s' limit 1",
- dbesc($hash)
+ $r = q("SELECT v FROM cache WHERE k = '%s' AND updated > %s - INTERVAL %s LIMIT 1",
+ dbesc($hash),
+ db_utcnow(),
+ db_quoteinterval(get_config('system','object_cache_days', '30') . ' DAY')
);
if ($r)
@@ -40,12 +42,5 @@ class Cache {
dbesc(datetime_convert()));
}
}
-
-
- public static function clear() {
- q("DELETE FROM cache WHERE updated < '%s'",
- dbesc(datetime_convert('UTC','UTC',"now - 30 days")));
- }
-
}