seaweedfs/weed/filesys/wfs_deletion.go

23 lines
472 B
Go
Raw Normal View History

2019-01-01 10:33:57 +00:00
package filesys
import (
"context"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
)
2019-03-16 00:20:24 +00:00
func (wfs *WFS) deleteFileChunks(ctx context.Context, chunks []*filer_pb.FileChunk) {
2019-01-06 06:51:50 +00:00
if len(chunks) == 0 {
return
}
var fileIds []string
for _, chunk := range chunks {
fileIds = append(fileIds, chunk.FileId)
}
2019-05-03 07:24:35 +00:00
wfs.WithFilerClient(ctx, func(client filer_pb.SeaweedFilerClient) error {
2019-03-16 00:20:24 +00:00
deleteFileIds(ctx, wfs.option.GrpcDialOption, client, fileIds)
2019-01-06 06:51:50 +00:00
return nil
})
2019-01-01 10:33:57 +00:00
}