This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git


The following commit(s) were added to refs/heads/main by this push:
     new dea64a9d Delete empty files directory when restoring (#841)
dea64a9d is described below

commit dea64a9dd6ae7f16739e70ac92db3c740f6857ef
Author: mrproliu <[email protected]>
AuthorDate: Fri Nov 7 19:47:45 2025 +0900

    Delete empty files directory when restoring (#841)
---
 banyand/backup/restore.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/banyand/backup/restore.go b/banyand/backup/restore.go
index cac485c8..0cc3e0bc 100644
--- a/banyand/backup/restore.go
+++ b/banyand/backup/restore.go
@@ -253,10 +253,11 @@ func cleanEmptyDirs(dir, stopDir string) {
                if dir == stopDir || dir == "." {
                        break
                }
-               entries, err := os.ReadDir(dir)
-               if err != nil || len(entries) > 0 {
+               files, err := getAllFiles(dir)
+               if err != nil || len(files) > 0 {
                        break
                }
+               logger.Infof("Detected empty file directory: %s, removing it", 
dir)
                _ = os.Remove(dir)
                dir = filepath.Dir(dir)
        }

Reply via email to