ffiwrapper: Use ClearCache for update cache cleanup

This commit is contained in:
Łukasz Magiera 2022-02-09 14:54:36 +01:00
parent 6cb411e5bb
commit f33cf74d0f

View File

@ -13,7 +13,6 @@ import (
"io"
"math/bits"
"os"
"path/filepath"
"runtime"
"github.com/ipfs/go-cid"
@ -886,8 +885,8 @@ func (sb *Sealer) FinalizeReplicaUpdate(ctx context.Context, sector storage.Sect
}
defer done()
if err := os.Remove(filepath.Join(paths.UpdateCache, "sc-02-data-tree-d.dat")); err != nil {
return xerrors.Errorf("clear update cache: %w", err)
if err := ffi.ClearCache(uint64(ssize), paths.UpdateCache); err != nil {
return xerrors.Errorf("clear cache: %w", err)
}
}