Skip to content

Commit

Permalink
chore: clean redundant log in client
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Ma <[email protected]>
  • Loading branch information
jim3ma committed Oct 29, 2021
1 parent 3141bd5 commit 10b45ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/daemon/storage/local_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ import (
"sync"
"time"

"go.uber.org/atomic"

"d7y.io/dragonfly/v2/client/clientutil"
"d7y.io/dragonfly/v2/internal/dferrors"
logger "d7y.io/dragonfly/v2/internal/dflog"
"d7y.io/dragonfly/v2/pkg/rpc/base"
"d7y.io/dragonfly/v2/pkg/util/digestutils"
"go.uber.org/atomic"
)

type localTaskStore struct {
Expand Down Expand Up @@ -342,19 +343,19 @@ func (t *localTaskStore) reclaimData(sLogger *logger.SugaredLoggerOnWith) error
if stat.Mode()&os.ModeSymlink == os.ModeSymlink {
dest, err0 := os.Readlink(data)
if err0 == nil {
if err = os.Remove(dest); err != nil {
if err = os.Remove(dest); err != nil && !os.IsNotExist(err){
sLogger.Warnf("remove symlink target file %s error: %s", dest, err)
} else {
sLogger.Infof("remove data file %s", dest)
}
}
} else { // remove cache file
if err = os.Remove(t.DataFilePath); err != nil {
if err = os.Remove(t.DataFilePath); err != nil && !os.IsNotExist(err) {
sLogger.Errorf("remove data file %s error: %s", data, err)
return err
}
}
if err = os.Remove(data); err != nil {
if err = os.Remove(data); err != nil && !os.IsNotExist(err){
sLogger.Errorf("remove data file %s error: %s", data, err)
return err
}
Expand Down

0 comments on commit 10b45ff

Please sign in to comment.