From 0cfab8ec82cfaa88af9e6fabe4dd9a407f7537dd Mon Sep 17 00:00:00 2001 From: rxdn <29165304+rxdn@users.noreply.github.com> Date: Sat, 16 Nov 2024 23:32:07 +0000 Subject: [PATCH] Use latch --- pkg/http/purgeguild.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/http/purgeguild.go b/pkg/http/purgeguild.go index 751716d..ee5c9d1 100644 --- a/pkg/http/purgeguild.go +++ b/pkg/http/purgeguild.go @@ -139,7 +139,7 @@ func (s *Server) purgeGuildHandler(ctx *gin.Context) { } } - close(removeCh) + latch.Done() }() // Fetch from the database @@ -161,6 +161,8 @@ func (s *Server) purgeGuildHandler(ctx *gin.Context) { Key: obj.S3Key(), } } + + latch.Done() }() // Close the remove channel when both goroutines have completed