diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-01-27 20:04:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 20:04:34 +0100 |
commit | 6cad3982cd1dc257b93b40628968596ed7b905bb (patch) | |
tree | a4aec27abf9e120fa804596108895b90ef683095 | |
parent | 7cd0e857ea3ca2916165af108cabe42ea44ea36a (diff) | |
parent | 8f1199453702c0d301c46225d2a1fc4689b62d21 (diff) | |
download | nextcloud-server-6cad3982cd1dc257b93b40628968596ed7b905bb.tar.gz nextcloud-server-6cad3982cd1dc257b93b40628968596ed7b905bb.zip |
Merge pull request #30775 from nextcloud/backport/30769/stable21
-rw-r--r-- | lib/private/Memcache/Memcached.php | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/lib/private/Memcache/Memcached.php b/lib/private/Memcache/Memcached.php index 7b852a418e1..9dab74e0e59 100644 --- a/lib/private/Memcache/Memcached.php +++ b/lib/private/Memcache/Memcached.php @@ -134,27 +134,8 @@ class Memcached extends Cache implements IMemcache { } public function clear($prefix = '') { - $prefix = $this->getNameSpace() . $prefix; - $allKeys = self::$cache->getAllKeys(); - if ($allKeys === false) { - // newer Memcached doesn't like getAllKeys(), flush everything - self::$cache->flush(); - return true; - } - $keys = []; - $prefixLength = strlen($prefix); - foreach ($allKeys as $key) { - if (substr($key, 0, $prefixLength) === $prefix) { - $keys[] = $key; - } - } - if (method_exists(self::$cache, 'deleteMulti')) { - self::$cache->deleteMulti($keys); - } else { - foreach ($keys as $key) { - self::$cache->delete($key); - } - } + // Newer Memcached doesn't like getAllKeys(), flush everything + self::$cache->flush(); return true; } |