Skip to content
Snippets Groups Projects

Issue #3364958: Stages should be destroyed in the background, during cron runs

Merged Issue #3364958: Stages should be destroyed in the background, during cron runs
1 unresolved thread
1 unresolved thread
1 file
+ 10
3
Compare changes
  • Side-by-side
  • Inline
@@ -541,9 +541,16 @@ abstract class StageBase implements LoggerAwareInterface {
// If the stage root directory exists, delete it and everything in it.
if (file_exists($staging_root)) {
try {
$this->fileSystem->deleteRecursive($staging_root, function (string $path): void {
$this->fileSystem->chmod($path, 0777);
});
// Instead of deleting it here we are just going to rename it.
$dirs = explode('/', $staging_root);
$delete_dir = end($dirs);
$delete_dir = 'DELETE_' . $delete_dir;
array_pop($dirs);
array_push($dirs, $delete_dir);
rename($staging_root, implode('/', $dirs));
// $this->fileSystem->deleteRecursive($staging_root, function (string $path): void {
// $this->fileSystem->chmod($path, 0777);
// });
}
catch (FileException) {
// Deliberately swallow the exception so that the stage will be marked
Loading