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