forked from leftypol/leftypol
RedisCacheDriver.php: flush only the key-value pairs with matching prefix
This commit is contained in:
parent
39635cfa33
commit
9b5906effe
1 changed files with 5 additions and 1 deletions
|
@ -45,6 +45,10 @@ class RedisCacheDriver implements CacheDriver {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function flush(): void {
|
public function flush(): void {
|
||||||
$this->inner->flushDB();
|
if (empty($this->prefix)) {
|
||||||
|
$this->inner->flushDB();
|
||||||
|
} else {
|
||||||
|
$this->inner->unlink($this->inner->keys("{$this->prefix}*"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue