Skip to content

Commit

Permalink
debug: Try to fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Oct 21, 2024
1 parent 6a0e117 commit f45c8ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/private/Files/Cache/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,14 @@ private function copyOrRenameFromStorage(IStorage $sourceStorage, string $source
$sourceInfo = $sourceCache->get($source);

if ($sourceInfo !== false) {
// Remove existing cache entry to no reuse the fileId.
if ($this->cache->inCache($target)) {
$this->cache->remove($target);
$existingCacheInfo = $this->cache->get($target);
// Do not remove the existing target if it has just been created.
// It was probably created by the same operation and we want to keep the fileId.
if (time() - $existingCacheInfo->getMTime() > 1) {
$this->cache->remove($target);
}
}

$operation($sourceCache, $sourceInfo);
Expand Down

0 comments on commit f45c8ed

Please sign in to comment.