Skip to content

Commit

Permalink
fix: Mutex deadlock
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Mar 17, 2023
1 parent d016acc commit cc0621c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/webhook/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ func (a *App) EventConsumer(ctx context.Context, event provider.Event) {
}

if event.Type == provider.DeleteEvent {
if err := a.deleteItem(ctx, event.Item); err != nil {
logger.Error("delete webhooks for item: %s", err)
}
// Fire a goroutine to release the mutex lock
go func() {
if err := a.deleteItem(ctx, event.Item); err != nil {
logger.Error("delete webhooks for item: %s", err)
}
}()
}
}

Expand Down

0 comments on commit cc0621c

Please sign in to comment.