worker: RemoveCopies expects one type at a time

This commit is contained in:
Łukasz Magiera 2022-03-16 12:03:44 +01:00
parent 5ed5744cb6
commit c4259cb594
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ type Remote struct {
func (r *Remote) RemoveCopies(ctx context.Context, s abi.SectorID, typ storiface.SectorFileType) error { func (r *Remote) RemoveCopies(ctx context.Context, s abi.SectorID, typ storiface.SectorFileType) error {
if bits.OnesCount(uint(typ)) != 1 { if bits.OnesCount(uint(typ)) != 1 {
return xerrors.New("delete expects one file type") return xerrors.New("RemoveCopies expects one file type")
} }
if err := r.local.RemoveCopies(ctx, s, typ); err != nil { if err := r.local.RemoveCopies(ctx, s, typ); err != nil {

View File

@ -525,7 +525,7 @@ func (l *LocalWorker) MoveStorage(ctx context.Context, sector storage.SectorRef,
continue continue
} }
if err := l.storage.RemoveCopies(ctx, sector.ID, types); err != nil { if err := l.storage.RemoveCopies(ctx, sector.ID, fileType); err != nil {
return nil, xerrors.Errorf("rm copies (t:%s, s:%v): %w", fileType, sector, err) return nil, xerrors.Errorf("rm copies (t:%s, s:%v): %w", fileType, sector, err)
} }
} }