From ec42da93eb6817a8310b04681f211189ee50b718 Mon Sep 17 00:00:00 2001 From: alimy Date: Tue, 19 Jul 2022 10:24:11 +0800 Subject: [PATCH] fixed delete oss object not expected result --- internal/service/post.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/post.go b/internal/service/post.go index 24c67aad..661b70a0 100644 --- a/internal/service/post.go +++ b/internal/service/post.go @@ -231,7 +231,7 @@ func deleteOssObjects(mediaContents []string) { mediaContentsSize := len(mediaContents) if mediaContentsSize > 1 { objectKeys := make([]string, 0, mediaContentsSize) - for _, cUrl := range objectKeys { + for _, cUrl := range mediaContents { objectKeys = append(objectKeys, oss.ObjectKey(cUrl)) } // TODO: 优化处理尽量使用channel传递objectKeys使用可控数量的Goroutine集中处理object删除动作,后续完善