Skip to content

Commit 2a67dc1

Browse files
committed
[12.x] flushStaleEntries for PhpRedisCluster in RedisTagSet
1 parent ab170e7 commit 2a67dc1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Illuminate/Cache/RedisTagSet.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,18 @@ public function entries()
7979
*/
8080
public function flushStaleEntries()
8181
{
82-
$this->store->connection()->pipeline(function ($pipe) {
82+
$flushStaleEntries = function ($pipe) {
8383
foreach ($this->tagIds() as $tagKey) {
8484
$pipe->zremrangebyscore($this->store->getPrefix().$tagKey, 0, Carbon::now()->getTimestamp());
8585
}
86-
});
86+
};
87+
88+
$connection = $this->store->connection();
89+
if ($connection instanceof PhpRedisConnection) {
90+
$flushStaleEntries($connection);
91+
} else {
92+
$connection->pipeline($flushStaleEntries);
93+
}
8794
}
8895

8996
/**

0 commit comments

Comments
 (0)