Skip to content

Commit

Permalink
fix: Fix concurrent issue
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Aug 4, 2024
1 parent 89197e9 commit e817935
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/sweeper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ func main() {

for _, channel := range channels {
wg.Add(1)
go func() {
go func(channelID string) {
defer wg.Done()

if err := services.discord.Messages(ctx, req, channel.ID, messagesCh); err != nil {
if err := services.discord.Messages(ctx, req, channelID, messagesCh); err != nil {
slog.Error("list messages", slog.Any("error", err))
}
}()
}(channel.ID)
}

for message := range messagesCh {
Expand Down

0 comments on commit e817935

Please sign in to comment.