Skip to content

Commit

Permalink
fix: Increase random sleep range in Bitbucket eventsource (#2148)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Wang <[email protected]>
  • Loading branch information
daniel-codefresh authored and whynowy committed Sep 10, 2022
1 parent a82ccd3 commit 7375545
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eventsources/sources/bitbucket/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (el *EventListener) StartListening(ctx context.Context, dispatch func([]byt

// When running multiple replicas of the eventsource, they will all try to create the webhook.
// Randomly sleep some time to mitigate the issue.
randomNum, _ := rand.Int(rand.Reader, big.NewInt(int64(2000)))
randomNum, _ := rand.Int(rand.Reader, big.NewInt(int64(5000)))
time.Sleep(time.Duration(randomNum.Int64()) * time.Millisecond)
applyWebhooks()

Expand Down

0 comments on commit 7375545

Please sign in to comment.