From: Maximilian Mader Date: Wed, 31 Dec 2014 15:59:04 +0000 (+0100) Subject: Implement RedisCacheSource::flushAll() X-Git-Tag: 3.0.0_Beta_1~2305^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e82850b0b0a9930a6112ce2619c08a214c2fcfdc;p=GitHub%2FWoltLab%2FWCF.git Implement RedisCacheSource::flushAll() --- 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'); } /**