RedisCacheDriver.php: flush only the key-value pairs with matching prefix

This commit is contained in:
Zankaria 2024-10-28 22:56:27 +01:00
parent 39635cfa33
commit 9b5906effe

View file

@ -45,6 +45,10 @@ class RedisCacheDriver implements CacheDriver {
}
public function flush(): void {
$this->inner->flushDB();
if (empty($this->prefix)) {
$this->inner->flushDB();
} else {
$this->inner->unlink($this->inner->keys("{$this->prefix}*"));
}
}
}