Skip to content

Commit f6a74f6

Browse files
committed
Additionally, check if filesize is 0 before deleting the lock files.
1 parent 25c0832 commit f6a74f6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function lock(string $name, int $timeout = -1): bool
106106
}
107107

108108
/**
109-
* Find lock files that haven't been touched in the last 24 hours and are unlocked, and delete those
109+
* Find lock files that haven't been touched in the last 24 hours, are 0 bytes and are unlocked, then delete those
110110
*/
111111
public function cleanupOldLocks(): int
112112
{
@@ -128,6 +128,11 @@ public function cleanupOldLocks(): int
128128
continue;
129129
}
130130

131+
$filesize = filesize($lockFile);
132+
if ($filesize !== 0) {
133+
continue;
134+
}
135+
131136
if ($this->isLocked(basename($lockFile))) {
132137
continue;
133138
}

0 commit comments

Comments
 (0)