remove unecessary mutex usage in healthchecks
This commit is contained in:
parent
5140bbe99a
commit
c134dcd6fe
1 changed files with 0 additions and 3 deletions
|
@ -49,7 +49,6 @@ type BackendHealthCheck struct {
|
|||
|
||||
//HealthCheck struct
|
||||
type HealthCheck struct {
|
||||
mutex sync.Mutex
|
||||
Backends map[string]*BackendHealthCheck
|
||||
cancel context.CancelFunc
|
||||
}
|
||||
|
@ -78,14 +77,12 @@ func NewBackendHealthCheck(options Options, backendName string) *BackendHealthCh
|
|||
|
||||
//SetBackendsConfiguration set backends configuration
|
||||
func (hc *HealthCheck) SetBackendsConfiguration(parentCtx context.Context, backends map[string]*BackendHealthCheck) {
|
||||
hc.mutex.Lock()
|
||||
hc.Backends = backends
|
||||
if hc.cancel != nil {
|
||||
hc.cancel()
|
||||
}
|
||||
ctx, cancel := context.WithCancel(parentCtx)
|
||||
hc.cancel = cancel
|
||||
hc.mutex.Unlock()
|
||||
|
||||
for _, backend := range backends {
|
||||
currentBackend := backend
|
||||
|
|
Loading…
Reference in a new issue