Browse Source

Update webdav_server.go

pull/1255/head
Chris Lu 5 years ago
parent
commit
a5aa8be19b
  1. 16
      weed/server/webdav_server.go

16
weed/server/webdav_server.go

@ -255,23 +255,9 @@ func (fs *WebDavFileSystem) removeAll(ctx context.Context, fullFilePath string)
//_, err = fs.db.Exec(`delete from filesystem where fullFilePath = ?`, fullFilePath) //_, err = fs.db.Exec(`delete from filesystem where fullFilePath = ?`, fullFilePath)
} }
dir, name := util.FullPath(fullFilePath).DirAndName() dir, name := util.FullPath(fullFilePath).DirAndName()
err = fs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
request := &filer_pb.DeleteEntryRequest{
Directory: dir,
Name: name,
IsDeleteData: true,
}
glog.V(3).Infof("removing entry: %v", request)
_, err := client.DeleteEntry(ctx, request)
if err != nil {
return fmt.Errorf("remove %s: %v", fullFilePath, err)
}
return filer_pb.Remove(fs, dir, name, true, true, true)
return nil
})
return err
} }
func (fs *WebDavFileSystem) RemoveAll(ctx context.Context, name string) error { func (fs *WebDavFileSystem) RemoveAll(ctx context.Context, name string) error {

Loading…
Cancel
Save