diff --git a/cmd/lotus-seal-worker/sub.go b/cmd/lotus-seal-worker/sub.go index 1043aa5ea..36cb79fb5 100644 --- a/cmd/lotus-seal-worker/sub.go +++ b/cmd/lotus-seal-worker/sub.go @@ -127,6 +127,10 @@ func (w *worker) processTask(ctx context.Context, task sectorbuilder.WorkerTask) if err := w.push("cache", task.SectorID); err != nil { return errRes(xerrors.Errorf("pushing precommited data: %w", err)) } + + if err := w.remove("sealed", task.SectorID); err != nil { + return errRes(xerrors.Errorf("cleaning up sealed sector: %w", err)) + } } return res diff --git a/cmd/lotus-seal-worker/transfer.go b/cmd/lotus-seal-worker/transfer.go index 9697a4bad..ea1bec786 100644 --- a/cmd/lotus-seal-worker/transfer.go +++ b/cmd/lotus-seal-worker/transfer.go @@ -125,6 +125,11 @@ func (w *worker) push(typ string, sectorID uint64) error { } // TODO: keep files around for later stages of sealing + return w.remove(typ, sectorID) +} + +func (w *worker) remove(typ string, sectorID uint64) error { + filename := filepath.Join(w.repo, typ, w.sb.SectorName(sectorID)) return os.RemoveAll(filename) }