diff options
Diffstat (limited to 'weed/filesys/wfs_deletion.go')
| -rw-r--r-- | weed/filesys/wfs_deletion.go | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/weed/filesys/wfs_deletion.go b/weed/filesys/wfs_deletion.go index 45eb68397..f58ef24f4 100644 --- a/weed/filesys/wfs_deletion.go +++ b/weed/filesys/wfs_deletion.go @@ -35,12 +35,24 @@ func (wfs *WFS) loopProcessingDeletion() { } -func (wfs *WFS) asyncDeleteFileChunks(chunks []*filer_pb.FileChunk) { - if len(chunks) > 0 { - var fileIds []string - for _, chunk := range chunks { - fileIds = append(fileIds, chunk.FileId) - } +func (wfs *WFS) deleteFileChunks(chunks []*filer_pb.FileChunk) { + if len(chunks) == 0 { + return + } + + var fileIds []string + for _, chunk := range chunks { + fileIds = append(fileIds, chunk.FileId) + } + + var async = false + if async { wfs.fileIdsDeletionChan <- fileIds + return } + + wfs.withFilerClient(func(client filer_pb.SeaweedFilerClient) error { + deleteFileIds(context.Background(), client, fileIds) + return nil + }) } |
