2019-01-01 10:33:57 +00:00
|
|
|
package filesys
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
|
|
|
)
|
|
|
|
|
2019-01-06 06:51:50 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
|
|
|
wfs.withFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
2019-02-18 20:11:52 +00:00
|
|
|
deleteFileIds(context.Background(), wfs.option.GrpcDialOption, client, fileIds)
|
2019-01-06 06:51:50 +00:00
|
|
|
return nil
|
|
|
|
})
|
2019-01-01 10:33:57 +00:00
|
|
|
}
|