mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
refactor error contains already deleted (#3932)
This commit is contained in:
parent
975be5ea6f
commit
4a48332248
|
@ -1,6 +1,7 @@
|
||||||
package filer
|
package filer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/seaweedfs/seaweedfs/weed/storage"
|
||||||
"math"
|
"math"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -54,7 +55,7 @@ func (f *Filer) loopProcessingDeletion() {
|
||||||
deletionCount = len(toDeleteFileIds)
|
deletionCount = len(toDeleteFileIds)
|
||||||
_, err := operation.DeleteFilesWithLookupVolumeId(f.GrpcDialOption, toDeleteFileIds, lookupFunc)
|
_, err := operation.DeleteFilesWithLookupVolumeId(f.GrpcDialOption, toDeleteFileIds, lookupFunc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !strings.Contains(err.Error(), "already deleted") {
|
if !strings.Contains(err.Error(), storage.ErrorDeleted.Error()) {
|
||||||
glog.V(0).Infof("deleting fileIds len=%d error: %v", deletionCount, err)
|
glog.V(0).Infof("deleting fileIds len=%d error: %v", deletionCount, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -86,7 +87,7 @@ func (f *Filer) doDeleteFileIds(fileIds []string) {
|
||||||
deletionCount := len(toDeleteFileIds)
|
deletionCount := len(toDeleteFileIds)
|
||||||
_, err := operation.DeleteFilesWithLookupVolumeId(f.GrpcDialOption, toDeleteFileIds, lookupFunc)
|
_, err := operation.DeleteFilesWithLookupVolumeId(f.GrpcDialOption, toDeleteFileIds, lookupFunc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !strings.Contains(err.Error(), "already deleted") {
|
if !strings.Contains(err.Error(), storage.ErrorDeleted.Error()) {
|
||||||
glog.V(0).Infof("deleting fileIds len=%d error: %v", deletionCount, err)
|
glog.V(0).Infof("deleting fileIds len=%d error: %v", deletionCount, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue