first write Error file then Move File, so the move error can also be detected while the error writing is always done first
All checks were successful
go/archiver/pipeline/head This commit looks good
All checks were successful
go/archiver/pipeline/head This commit looks good
This commit is contained in:
parent
1fa1d47e63
commit
1449729882
1 changed files with 4 additions and 1 deletions
|
@ -94,10 +94,13 @@ func moveToError(conf *Config, filePath string, archiveErr error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = os.Rename(filePath, filepath.Join(destFolder, baseName))
|
|
||||||
err = writeErrorFile(conf, filePath, archiveErr)
|
err = writeErrorFile(conf, filePath, archiveErr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
err = os.Rename(filePath, filepath.Join(destFolder, baseName))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue