Skip to content
Snippets Groups Projects
Commit 4286a218 authored by Erick Hitter's avatar Erick Hitter
Browse files

Support delay before flushing Redis

parent 01b7283c
No related branches found
No related tags found
No related merge requests found
...@@ -908,6 +908,11 @@ class WP_Object_Cache { ...@@ -908,6 +908,11 @@ class WP_Object_Cache {
* @return bool Returns TRUE on success or FALSE on failure. * @return bool Returns TRUE on success or FALSE on failure.
*/ */
public function flush( $delay = 0 ) { public function flush( $delay = 0 ) {
$delay = absint( $delay );
if ( $delay ) {
sleep( $delay );
}
$result = $this->redis->flushall(); $result = $this->redis->flushall();
return $result; return $result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment