Skip to content

Commit

Permalink
Skip removing top-level files from temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksold authored Feb 26, 2025
1 parent 50fb547 commit 020486b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Command/CatalogAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,17 @@ protected function getTmpFilePaths($useCache = true, int $maxLifetimeInHours = 0
if ($this->driverFile->isDirectory($filePath)) {
// Skip directories
unset($this->tmpFilePaths[$k]);
} elseif ($this->driverFile->isFile($filePath)
&& $this->driverFile->isReadable($filePath)
&& (time() - $this->driverFile->stat($filePath)['mtime']) < $maxLifetime
) {
// Skip newly created files
unset($this->tmpFilePaths[$k]);
} elseif ($this->driverFile->isFile($filePath) && $this->driverFile->isReadable($filePath)) {
if ($this->getTmpMediaDirectoryPath() === $this->driverFile->getParentDirectory($filePath)) {
// Skip top-level files
unset($this->tmpFilePaths[$k]);
continue;
}

if ((time() - $this->driverFile->stat($filePath)['mtime']) > $maxLifetime) {
// Skip new files
unset($this->tmpFilePaths[$k]);
}
}
}
}
Expand Down

0 comments on commit 020486b

Please sign in to comment.