mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-01 16:28:17 +08:00
minor optimization
This commit is contained in:
parent
f5837b7000
commit
24c8e6bcb4
@ -61,8 +61,13 @@ func (mc *MetaCache) AtomicUpdateEntry(ctx context.Context, oldPath util.FullPat
|
|||||||
oldDir, _ := oldPath.DirAndName()
|
oldDir, _ := oldPath.DirAndName()
|
||||||
if mc.visitedBoundary.HasVisited(util.FullPath(oldDir)) {
|
if mc.visitedBoundary.HasVisited(util.FullPath(oldDir)) {
|
||||||
if oldPath != "" {
|
if oldPath != "" {
|
||||||
if err := mc.actualStore.DeleteEntry(ctx, oldPath); err != nil {
|
if oldPath == newEntry.FullPath {
|
||||||
return err
|
// skip the unnecessary deletion
|
||||||
|
// leave the update to the following InsertEntry operation
|
||||||
|
} else {
|
||||||
|
if err := mc.actualStore.DeleteEntry(ctx, oldPath); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user