From 40be3574e1857e2122f8a700c86a2d54df6db91a Mon Sep 17 00:00:00 2001 From: huanghaoyuanhhy Date: Tue, 5 Mar 2024 19:16:25 +0800 Subject: [PATCH] storage: fix az delete obj bug Signed-off-by: huanghaoyuanhhy --- storage/azure.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/storage/azure.go b/storage/azure.go index 28e3e66..07b87c3 100644 --- a/storage/azure.go +++ b/storage/azure.go @@ -271,9 +271,13 @@ func (a *AzureClient) DeleteObjects(ctx context.Context, i DeleteObjectsInput) e wp.Start() for _, key := range i.Keys { - if _, err := a.cli.DeleteBlob(ctx, i.Bucket, key, nil); err != nil { - return fmt.Errorf("storage: azure delete object %w", err) + job := func(ctx context.Context) error { + if _, err := a.cli.DeleteBlob(ctx, i.Bucket, key, nil); err != nil { + return fmt.Errorf("storage: azure delete object %w", err) + } + return nil } + wp.Submit(job) } wp.Done()