Browse Source

small refactoring

pull/5494/merge
chrislu 5 months ago
parent
commit
4e7d8eb3f1
  1. 4
      weed/filer/filer_delete_entry.go
  2. 7
      weed/server/filer_grpc_server.go

4
weed/filer/filer_delete_entry.go

@ -55,7 +55,7 @@ func (f *Filer) DeleteEntryMetaAndData(ctx context.Context, p util.FullPath, isR
if isDeleteCollection { if isDeleteCollection {
collectionName := entry.Name() collectionName := entry.Name()
f.doDeleteCollection(collectionName)
f.DoDeleteCollection(collectionName)
} }
return nil return nil
@ -133,7 +133,7 @@ func (f *Filer) doDeleteEntryMetaAndData(ctx context.Context, entry *Entry, shou
return nil return nil
} }
func (f *Filer) doDeleteCollection(collectionName string) (err error) {
func (f *Filer) DoDeleteCollection(collectionName string) (err error) {
return f.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error { return f.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error {
_, err := client.CollectionDelete(context.Background(), &master_pb.CollectionDeleteRequest{ _, err := client.CollectionDelete(context.Background(), &master_pb.CollectionDeleteRequest{

7
weed/server/filer_grpc_server.go

@ -363,12 +363,7 @@ func (fs *FilerServer) DeleteCollection(ctx context.Context, req *filer_pb.Delet
glog.V(4).Infof("DeleteCollection %v", req) glog.V(4).Infof("DeleteCollection %v", req)
err = fs.filer.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error {
_, err := client.CollectionDelete(context.Background(), &master_pb.CollectionDeleteRequest{
Name: req.GetCollection(),
})
return err
})
err = fs.filer.DoDeleteCollection(req.GetCollection())
return &filer_pb.DeleteCollectionResponse{}, err return &filer_pb.DeleteCollectionResponse{}, err
} }
Loading…
Cancel
Save