Skip to content

Commit 1a2e320

Browse files
committed
fix(KeyValueCache): allow negative TTL for file locking
file locking uses negative TTL, returning the default will break. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 547e4e7 commit 1a2e320

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/private/Memcache/KeyValueCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ protected function evalLua(string $scriptName, array $keys, array $args) {
232232
* so fall back to the default and cap it to the maximum.
233233
*/
234234
private function normalizeTtl(int $ttl): int {
235-
if ($ttl <= 0) {
235+
if ($ttl === 0) { // we need to allow negative TTL for file locking
236236
$ttl = self::DEFAULT_TTL;
237237
}
238238
return min($ttl, self::MAX_TTL);

0 commit comments

Comments
 (0)