summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index fae289ba8..33a7c5cbc 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -169,14 +169,16 @@ function rcmail_cache_gc()
// get target timestamp
$ts = get_offset_time($rcmail->config->get('message_cache_lifetime', '30d'), -1);
- $db->query("DELETE FROM ".get_table_name('cache_messages')
+ if ($rcmail->config->get('messages_cache') || $this->config->get('enable_caching')) {
+ $db->query("DELETE FROM ".get_table_name('cache_messages')
." WHERE changed < " . $db->fromunixtime($ts));
- $db->query("DELETE FROM ".get_table_name('cache_index')
+ $db->query("DELETE FROM ".get_table_name('cache_index')
." WHERE changed < " . $db->fromunixtime($ts));
- $db->query("DELETE FROM ".get_table_name('cache_thread')
+ $db->query("DELETE FROM ".get_table_name('cache_thread')
." WHERE changed < " . $db->fromunixtime($ts));
+ }
$db->query("DELETE FROM ".get_table_name('cache')
." WHERE created < " . $db->fromunixtime($ts));