small refactoring

This commit is contained in:
chrislu
2024-07-11 14:50:09 -07:00
parent b62f7c5122
commit 4e7d8eb3f1
2 changed files with 3 additions and 8 deletions

View File

@@ -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{

View File

@@ -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 = fs.filer.DoDeleteCollection(req.GetCollection())
_, err := client.CollectionDelete(context.Background(), &master_pb.CollectionDeleteRequest{
Name: req.GetCollection(),
})
return err
})
return &filer_pb.DeleteCollectionResponse{}, err return &filer_pb.DeleteCollectionResponse{}, err
} }