Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/FileCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,17 @@ public function delete(string $key): bool
return true;
}

return @unlink($file);
$result = @unlink($file);
// Check if error was because of file was already deleted by another process on high load
if ($result === false) {
$lastError = error_get_last();
if (str_ends_with($lastError['message'] ?? '', 'No such file or directory')) {
error_clear_last();
return true;
}
}

return $result;
}

public function clear(): bool
Expand Down