Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions featureflag/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/sirupsen/logrus"
)

var globalLock sync.Mutex
var globalLock sync.RWMutex
var globalClient Client = MockClient{}

func SetGlobalClient(client Client) {
Expand All @@ -19,8 +19,8 @@ func SetGlobalClient(client Client) {
}

func GetGlobalClient() Client {
globalLock.Lock()
defer globalLock.Unlock()
globalLock.RLock()
defer globalLock.RUnlock()
return globalClient
}

Expand Down