Skip to content

Commit

Permalink
make variables to consts
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Jan 16, 2024
1 parent e76035a commit e582c18
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions testing/eventmeshmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import (
const (
TokenURLPath = "/auth"
MessagingURLPath = "/messaging"

fewAttempts = 2
smallInterval = 3
)

// EventMeshMock implements a programmable mock for EventMesh.
Expand Down Expand Up @@ -210,9 +213,8 @@ func (m *EventMeshMock) handleMessaging() func(w http.ResponseWriter, r *http.Re
if err == nil {
break
}
attempts, duration := 2, 3
if i < attempts { // Don't sleep after the last attempt.
time.Sleep(time.Duration(duration) * time.Second)
if i < fewAttempts { // Don't sleep after the last attempt.
time.Sleep(time.Duration(smallInterval) * time.Second)
} else {
m.log.Error(err, "failed to update state response")
w.WriteHeader(http.StatusBadRequest)
Expand Down

0 comments on commit e582c18

Please sign in to comment.