Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4907be1

Browse files
Wickexnicolas-grekas
authored andcommitted
[Cache] Fixed incorrect usage of UNLINK with PHPRedis with Redis < 4.0
1 parent 2b36487 commit 4907be1

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/Symfony/Component/Cache/Traits/RedisTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ protected function doDelete(array $ids)
408408

409409
if ($unlink) {
410410
try {
411-
$this->redis->unlink($ids);
411+
$unlink = false !== $this->redis->unlink($ids);
412412

413413
return true;
414414
} catch (\Throwable $e) {

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected function doDestroy(string $sessionId): bool
9393

9494
if ($unlink) {
9595
try {
96-
$this->redis->unlink($this->prefix.$sessionId);
96+
$unlink = false !== $this->redis->unlink($this->prefix.$sessionId);
9797

9898
return true;
9999
} catch (\Throwable $e) {

src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,17 +485,15 @@ public function cleanup(): void
485485

486486
if ($unlink) {
487487
try {
488-
$this->connection->unlink($this->stream);
489-
$this->connection->unlink($this->queue);
488+
$unlink = false !== $this->connection->unlink($this->stream, $this->queue);
490489

491490
return;
492491
} catch (\Throwable $e) {
493492
$unlink = false;
494493
}
495494
}
496495

497-
$this->connection->del($this->stream);
498-
$this->connection->del($this->queue);
496+
$this->connection->del($this->stream, $this->queue);
499497
}
500498
}
501499
class_alias(Connection::class, \Symfony\Component\Messenger\Transport\RedisExt\Connection::class);

0 commit comments

Comments
 (0)