]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache: try to set the fast cache in the Broker
authorBart Visscher <bartv@thisnet.nl>
Mon, 25 Jun 2012 15:59:06 +0000 (17:59 +0200)
committerBart Visscher <bartv@thisnet.nl>
Mon, 25 Jun 2012 19:05:10 +0000 (21:05 +0200)
lib/cache/broker.php

index 62a7cd96d15db7c1e682fb31f490159bf65d42b8..931d0dd407e64546d3ef41bf27ecb75b0f28594f 100644 (file)
@@ -23,15 +23,13 @@ class OC_Cache_Broker {
        }
 
        public function set($key, $value, $ttl=0) {
-               $set_slow = strlen($value) > 8192;
-               if ($set_slow) {
+               if (!$this->fast_cache->set($key, $value, $ttl)) {
                        if ($this->fast_cache->hasKey($key)) {
                                $this->fast_cache->remove($key);
                        }
-                       $this->slow_cache->set($key, $value, $ttl);
-               } else {
-                       $this->fast_cache->set($key, $value, $ttl);
+                       return $this->slow_cache->set($key, $value, $ttl);
                }
+               return true;
        }
 
        public function hasKey($key) {