Skip to content

Commit 2cfcb1e

Browse files
committed
MC-34211: Cache lock implementation cannot acquire infinite lock
1 parent 4e085c7 commit 2cfcb1e

File tree

1 file changed

+2
-1
lines changed
  • lib/internal/Magento/Framework/Lock/Backend

1 file changed

+2
-1
lines changed

lib/internal/Magento/Framework/Lock/Backend/Cache.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function lock(string $name, int $timeout = -1): bool
5555
return false;
5656
}
5757

58-
$this->cache->save($this->lockSign, $this->getIdentifier($name), [], $timeout * 100);
58+
$timeout = $timeout <= 0 ? null : $timeout;
59+
$this->cache->save($this->lockSign, $this->getIdentifier($name), [], $timeout);
5960

6061
$data = $this->cache->load($this->getIdentifier($name));
6162

0 commit comments

Comments
 (0)