Skip to content

Commit

Permalink
Use a boolean variable for retry fail
Browse files Browse the repository at this point in the history
  • Loading branch information
charlieegan3 committed Sep 10, 2021
1 parent 859d919 commit b0cd5b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/carddav/backoff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
)

func TestBackoff(t *testing.T) {
requestCount := 0
requestShouldFail := true
testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
requestCount++
if requestCount < 2 {
if requestShouldFail {
requestShouldFail = false
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down

0 comments on commit b0cd5b8

Please sign in to comment.