aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs_deletion.go
blob: dd79928168ae78d0e6e9330ba7d40631d3b49759 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package filesys

import (
	"context"
	"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
)

func (wfs *WFS) deleteFileChunks(ctx context.Context, chunks []*filer_pb.FileChunk) {
	if len(chunks) == 0 {
		return
	}

	var fileIds []string
	for _, chunk := range chunks {
		fileIds = append(fileIds, chunk.FileId)
	}

	wfs.WithFilerClient(ctx, func(client filer_pb.SeaweedFilerClient) error {
		deleteFileIds(ctx, wfs.option.GrpcDialOption, client, fileIds)
		return nil
	})
}