Browse Source

memcached fix

spaghetti 3 months ago
parent
commit
baccd5da2c
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      classes/cache.class.php

+ 3
- 1
classes/cache.class.php View File

@@ -102,7 +102,9 @@ class Cache extends MemcacheCompat {
102 102
   // Wrapper for Memcache::add, with the zlib option removed and default duration of 30 days
103 103
   public function add_value($Key, $Value, $Duration = 2592000) {
104 104
     $StartTime = microtime(true);
105
-    $Added = $this->add($Key, $Value, 0, $Duration);
105
+    $AddParams = [$Key, $Value, false, $Duration];
106
+    if (is_subclass_of($this, 'Memcached')) unset($AddParams[2]);
107
+    $Added = $this->add(...$AddParams);
106 108
     $this->Time += (microtime(true) - $StartTime) * 1000;
107 109
     return $Added;
108 110
   }

Loading…
Cancel
Save