mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
skip deletion if entry not found
This commit is contained in:
parent
f124ebab1d
commit
603de2d5db
|
@ -79,7 +79,10 @@ func (store *AbstractSqlStore) FindEntry(fullpath filer2.FullPath) (*filer2.Entr
|
||||||
|
|
||||||
func (store *AbstractSqlStore) DeleteEntry(fullpath filer2.FullPath) (*filer2.Entry, error) {
|
func (store *AbstractSqlStore) DeleteEntry(fullpath filer2.FullPath) (*filer2.Entry, error) {
|
||||||
|
|
||||||
entry, _ := store.FindEntry(fullpath)
|
entry, err := store.FindEntry(fullpath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
dir, name := fullpath.DirAndName()
|
dir, name := fullpath.DirAndName()
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,10 @@ func (store *LevelDBStore) FindEntry(fullpath filer2.FullPath) (entry *filer2.En
|
||||||
func (store *LevelDBStore) DeleteEntry(fullpath filer2.FullPath) (entry *filer2.Entry, err error) {
|
func (store *LevelDBStore) DeleteEntry(fullpath filer2.FullPath) (entry *filer2.Entry, err error) {
|
||||||
key := genKey(fullpath.DirAndName())
|
key := genKey(fullpath.DirAndName())
|
||||||
|
|
||||||
entry, _ = store.FindEntry(fullpath)
|
entry, err = store.FindEntry(fullpath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
err = store.db.Delete(key, nil)
|
err = store.db.Delete(key, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue