summaryrefslogtreecommitdiff
path: root/plugins/redundant_attachments/redundant_attachments.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-06-13 13:47:09 +0200
committerAleksander Machniak <alec@alec.pl>2013-06-13 13:47:09 +0200
commitdf9d004cf838ec3e7e8f26d8255ffb78665c1c59 (patch)
tree1f4ae625cc6036af1d58f799753a94999f08488d /plugins/redundant_attachments/redundant_attachments.php
parent12f1190a62f4df7d681a320b00c2c906b9158c70 (diff)
Set TTL for attachments stored in sql database
Diffstat (limited to 'plugins/redundant_attachments/redundant_attachments.php')
-rw-r--r--plugins/redundant_attachments/redundant_attachments.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/redundant_attachments/redundant_attachments.php b/plugins/redundant_attachments/redundant_attachments.php
index 4ebc8dad7..c0affad3c 100644
--- a/plugins/redundant_attachments/redundant_attachments.php
+++ b/plugins/redundant_attachments/redundant_attachments.php
@@ -68,13 +68,14 @@ class redundant_attachments extends filesystem_attachments
// load configuration
$this->load_config();
+ $ttl = 12 * 60 * 60; // 12 hours
+ $ttl = $rcmail->config->get('redundant_attachments_cache_ttl', $ttl);
+
// Init SQL cache (disable cache data serialization)
- $this->cache = $rcmail->get_cache($this->prefix, 'db', 0, false);
+ $this->cache = $rcmail->get_cache($this->prefix, 'db', $ttl, false);
// Init memcache (fallback) cache
if ($rcmail->config->get('redundant_attachments_memcache')) {
- $ttl = 12 * 60 * 60; // 12 hours
- $ttl = (int) $rcmail->config->get('redundant_attachments_memcache_ttl', $ttl);
$this->mem_cache = $rcmail->get_cache($this->prefix, 'memcache', $ttl, false);
}