fix: correct RemoveWithRetry error handling (#39619)

* Fix #39618
* Follow up #38588
* Remove unrelated errors
This commit is contained in:
wxiaoguang authored and GitHub committed 2026-10-06 07:45:31 +00:00
1 parent 1264072754
commit fc1f0dbec4
2 files changed
+7 -3

No files matched your search

+1 -1
View File
@@ -119,7 +119,7 @@ func (l *LocalStorage) Stat(path string) (os.FileInfo, error) {
func (l *LocalStorage) deleteEmptyParentDirs(localFullPath string) {
for parent := filepath.Dir(localFullPath); len(parent) > len(l.dir); parent = filepath.Dir(parent) {
if err := util.RemoveWithRetry(parent); err != nil && !os.IsNotExist(err) {
if err := os.Remove(parent); err != nil && !os.IsNotExist(err) {
// since the target file has been deleted, parent dir error is not related to the file deletion itself.
break
}