From 13224e3e0ba23f0db280d8bd56ceeb18c583348e Mon Sep 17 00:00:00 2001 From: Phi Date: Tue, 4 Jul 2023 11:07:50 +0200 Subject: [PATCH] Remove unused function Remove unused clearSplitStoreDir function --- cmd/lotus/daemon.go | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index c77623876..2193dd1a5 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -28,7 +28,6 @@ import ( "go.opencensus.io/stats" "go.opencensus.io/stats/view" "go.opencensus.io/tag" - "go.uber.org/multierr" "golang.org/x/xerrors" "gopkg.in/cheggaaa/pb.v1" @@ -800,27 +799,3 @@ func deleteSplitstoreDir(lr repo.LockedRepo) error { return os.RemoveAll(path) } - -func clearSplitstoreDir(lr repo.LockedRepo) error { - path, err := lr.SplitstorePath() - if err != nil { - return xerrors.Errorf("error getting splitstore path: %w", err) - } - - entries, err := os.ReadDir(path) - if err != nil { - return xerrors.Errorf("error reading splitstore directory %s: %W", path, err) - } - - var result error - for _, e := range entries { - target := filepath.Join(path, e.Name()) - err = os.RemoveAll(target) - if err != nil { - log.Errorf("error removing %s: %s", target, err) - result = multierr.Append(result, err) - } - } - - return result -}