some more fixes

Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
Andy Miller
2025-11-08 11:43:50 +00:00
parent 678eacaae5
commit 72cc8e91a2

View File

@@ -256,7 +256,16 @@ class SafeUpgradeService
$this->persistManifest($manifest);
$this->lastManifest = $manifest;
$this->pruneOldSnapshots();
Folder::delete($stagePath);
// Clean up staging directory
// Wrap in try-catch because autoloader may have stale paths after file copy
try {
Folder::delete($stagePath);
} catch (\Throwable $e) {
// Staging cleanup failed, but upgrade succeeded
// Directory will be cleaned up on next request
error_log('Warning: Failed to delete staging directory: ' . $e->getMessage());
}
return $manifest;
}