disable async file deletion

This commit is contained in:
Chris Lu
2019-01-05 22:51:50 -08:00
parent be9a7592a1
commit bd32108a90
3 changed files with 21 additions and 9 deletions

View File

@@ -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)
}
wfs.fileIdsDeletionChan <- fileIds
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
})
}