mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix to avoid empty sub directory
This commit is contained in:
parent
51fafdb525
commit
d6aa6239de
|
@ -157,10 +157,12 @@ func (fs *FilerServer) ensureFolderHasEntry(path string, sub string) (err error)
|
||||||
} else if e != nil {
|
} else if e != nil {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
for _, v := range strings.Split(val, ":") {
|
list := strings.Split(val, ":")
|
||||||
|
for _, v := range list {
|
||||||
if v == sub {
|
if v == sub {
|
||||||
return nil
|
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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue