From e82850b0b0a9930a6112ce2619c08a214c2fcfdc Mon Sep 17 00:00:00 2001 From: Maximilian Mader Date: Wed, 31 Dec 2014 16:59:04 +0100 Subject: [PATCH] Implement RedisCacheSource::flushAll() --- .../files/lib/system/cache/source/RedisCacheSource.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php index aac947eab8..597f2fb233 100644 --- a/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php +++ b/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php @@ -73,7 +73,11 @@ class RedisCacheSource implements ICacheSource { * @see \wcf\system\cache\source\ICacheSource::flushAll() */ public function flushAll() { + // set flush key to current time if it does not exist yet (this prevents falling back to 0 if the key gets deleted) + $this->redis->setnx('_flush', TIME_NOW); + // atomic increment of flush count + $this->redis->incr('_flush'); } /** -- 2.20.1