summaryrefslogtreecommitdiff
path: root/plugins/MemcachePlugin.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-31 15:27:58 -0500
committerEvan Prodromou <evan@status.net>2010-01-31 15:27:58 -0500
commit779204b194447397d0770d96e291d9491fd731b9 (patch)
treed0bfe36cc2b743fce8507e8cf6851467ccec8789 /plugins/MemcachePlugin.php
parentbd5278302574ae3af87f09e0d8191c95ab93582a (diff)
parent81087e45c5b797028e90181459e4c673cd7be278 (diff)
Merge branch 'testing' into 0.9.x
Conflicts: actions/apioauthauthorize.php
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));