mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-19 22:50:55 +08:00
feat: encrypt S3 archives and test credentials and interruption recovery
This commit is contained in:
@@ -437,9 +437,16 @@ func recoverTaskArchiveStages(dataDir string, pg *pgdb.DB) error {
|
||||
stage := &taskArchiveFileStage{root: root, payload: filepath.Join(root, "payload"), journal: journal}
|
||||
if err := stage.rollback(); err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
if archive != nil && archive.ArchivePath != "" && !strings.HasPrefix(archive.ArchivePath, "s3://") {
|
||||
_ = os.Remove(archive.ArchivePath)
|
||||
// The process can exit after compression but before an upload journal or
|
||||
// database location exists. Remove that temporary package only after the
|
||||
// source-file rollback succeeds, for both local and remote backends.
|
||||
packagePath := taskArchivePath(dataDir, journal.ArchiveID, journal.TaskID)
|
||||
if err := validateArchivePath(dataDir, packagePath); err != nil {
|
||||
errs = append(errs, err)
|
||||
} else if err := removeLocalArchivePackage(packagePath); err != nil {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
}
|
||||
return errors.Join(errs...)
|
||||
|
||||
Reference in New Issue
Block a user