fix: storage: Remove temp fetching files after failed fetch
This commit is contained in:
parent
a7379e2cce
commit
7a4f69721c
@ -236,6 +236,10 @@ func (r *Remote) acquireFromRemote(ctx context.Context, s abi.SectorID, fileType
|
||||
err = r.fetchThrottled(ctx, url, tempDest)
|
||||
if err != nil {
|
||||
merr = multierror.Append(merr, xerrors.Errorf("fetch error %s (storage %s) -> %s: %w", url, info.ID, tempDest, err))
|
||||
// fetching failed, remove temp file
|
||||
if rerr := os.RemoveAll(tempDest); rerr != nil {
|
||||
merr = multierror.Append(merr, xerrors.Errorf("removing temp dest (post-err cleanup): %w", rerr))
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user