mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-19 22:44:18 +00:00
context
This commit is contained in:
@@ -310,8 +310,10 @@ func (fs *FilerServer) DeleteEntry(ctx context.Context, req *filer_pb.DeleteEntr
|
||||
stopAtPath = "/"
|
||||
}
|
||||
|
||||
// Clean up empty parent directories starting from req.Directory
|
||||
fs.filer.DeleteEmptyParentDirectories(ctx, util.FullPath(req.Directory), stopAtPath)
|
||||
// Use non-cancellable context to ensure cleanup completes atomically
|
||||
// even if the client cancels the request after deletion succeeds
|
||||
opCtx := context.WithoutCancel(ctx)
|
||||
fs.filer.DeleteEmptyParentDirectories(opCtx, util.FullPath(req.Directory), stopAtPath)
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
|
||||
Reference in New Issue
Block a user