Skip to content

Commit

Permalink
synchronize server side
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat committed Sep 27, 2024
1 parent 840600a commit 300db7f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions httprc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"net/http/httptest"
"strconv"
"sync"
"testing"
"time"

Expand Down Expand Up @@ -116,7 +117,10 @@ func TestClient(t *testing.T) {

func TestRefresh(t *testing.T) {
count := 0
var mu sync.Mutex
h := http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
mu.Lock()
defer mu.Unlock()
count++
json.NewEncoder(w).Encode(map[string]interface{}{"count": count})
})
Expand Down

0 comments on commit 300db7f

Please sign in to comment.