mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-01 09:50:39 +01:00
fix to avoid empty sub directory
This commit is contained in:
1 parent
51fafdb525
commit
d6aa6239de
1 file changed
+4
-2
@@ -157,10 +157,12 @@ func (fs *FilerServer) ensureFolderHasEntry(path string, sub string) (err error)
|
||||
} else if e != nil {
|
||||
return e
|
||||
}
|
||||
for _, v := range strings.Split(val, ":") {
|
||||
list := strings.Split(val, ":")
|
||||
for _, v := range list {
|
||||
if v == sub {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return fs.db.Put([]byte(path), []byte(val+":"+sub), nil)
|
||||
list = append(list, sub)
|
||||
return fs.db.Put([]byte(path), []byte(strings.Join(list, ":")), nil)
|
||||
}
|
||||
Reference in new issue
Block a user