Remove failed updater on double failure

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
Fedor Indutny 2024-08-14 14:10:34 -07:00 committed by GitHub
parent 3e007852d5
commit 2c0ccb2e36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -722,6 +722,17 @@ export abstract class Updater {
'downloadUpdate: Failed to restore from backup folder, ignoring',
Errors.toLogFormat(restoreError)
);
// If not possible - at least clean up
try {
await deleteTempDir(this.logger, restoreDir);
} catch (cleanupError) {
this.logger.warn(
'downloadUpdate: Failed to remove backup folder after ' +
'failed restore, ignoring',
Errors.toLogFormat(cleanupError)
);
}
}
this.logger.warn(