summaryrefslogtreecommitdiff
path: root/plugins/MemcachePlugin.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-01-28 16:55:37 -0800
committerBrion Vibber <brion@pobox.com>2010-01-28 16:55:37 -0800
commitda34de74fece355785710bc4ff0bab03389a2877 (patch)
treec6830f8edcae1cc508fd7cf32a1f6e6ff59ba580 /plugins/MemcachePlugin.php
parent63a0e84a8b94d84b106431b648ec76e2537ab9c6 (diff)
parentd13d73c5630244963f0c3bd9db68dd6c6451821a (diff)
Merge branch 'testing'
Diffstat (limited to 'plugins/MemcachePlugin.php')
-rw-r--r--plugins/MemcachePlugin.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/MemcachePlugin.php b/plugins/MemcachePlugin.php
index 8c8b8da6d..2bc4b892b 100644
--- a/plugins/MemcachePlugin.php
+++ b/plugins/MemcachePlugin.php
@@ -59,6 +59,8 @@ class MemcachePlugin extends Plugin
public $persistent = null;
+ public $defaultExpiry = 86400; // 24h
+
/**
* Initialize the plugin
*
@@ -110,6 +112,9 @@ class MemcachePlugin extends Plugin
function onStartCacheSet(&$key, &$value, &$flag, &$expiry, &$success)
{
$this->_ensureConn();
+ if ($expiry === null) {
+ $expiry = $this->defaultExpiry;
+ }
$success = $this->_conn->set($key, $value, $flag, $expiry);
Event::handle('EndCacheSet', array($key, $value, $flag,
$expiry));