Fix memcache locking issue.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 23 Jul 2009 20:18:10 +0000 (14:18 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 23 Jul 2009 20:18:10 +0000 (14:18 -0600)
If you don't specify a time value to delete(), apparently memcache takes
that as expiring in 1 second - not an instantaneous expire.  Which isn't
mentioned in the documentation and is not very intuitive (delete means
delete).  This was causing slow load times on message with a lot of
attached images - the thumbnails were slow to load because the sessions
were not being marked as unlocked for at least a second, preventing the
next image from loading.

framework/Memcache/lib/Horde/Memcache.php

index 9fcea2d..f8e0485 100644 (file)
@@ -383,7 +383,7 @@ class Horde_Memcache
      */
     public function unlock($key)
     {
-        $this->_memcache->delete($this->_key($key . '_l'));
+        $this->_memcache->delete($this->_key($key . '_l'), 0);
     }
 
     /**