Skip to content

Commit 769669d

Browse files
committed
FileCacheStorage - ignore concurrent save issues on Windows
1 parent f01b5e1 commit 769669d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Cache/FileCacheStorage.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,12 @@ public function save(string $key, string $variableKey, $data): void
8282
}
8383

8484
$renameSuccess = @rename($tmpPath, $path);
85-
if ($renameSuccess === false) {
86-
@unlink($tmpPath);
85+
if ($renameSuccess) {
86+
return;
87+
}
88+
89+
@unlink($tmpPath);
90+
if (DIRECTORY_SEPARATOR === '/' || !file_exists($path)) {
8791
throw new \InvalidArgumentException(sprintf('Could not write data to cache file %s.', $path));
8892
}
8993
}

0 commit comments

Comments
 (0)