mirror of https://github.com/grafana/grafana.git
Remote Alertmanager: Pass the sync.WaitGroup to the goroutine as an argument
This commit is contained in:
parent
ee4532925b
commit
bd6733a1b7
|
@ -131,7 +131,7 @@ func (fam *RemoteSecondaryForkedAlertmanager) ApplyConfig(ctx context.Context, c
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
// Figure out if we need to sync the external Alertmanager in another goroutine.
|
// Figure out if we need to sync the external Alertmanager in another goroutine.
|
||||||
go func() {
|
go func(wg sync.WaitGroup) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
// If the Alertmanager has not been marked as "ready" yet, delegate the call to the remote Alertmanager.
|
// If the Alertmanager has not been marked as "ready" yet, delegate the call to the remote Alertmanager.
|
||||||
// This will perform a readiness check and sync the Alertmanagers.
|
// This will perform a readiness check and sync the Alertmanagers.
|
||||||
|
@ -154,7 +154,7 @@ func (fam *RemoteSecondaryForkedAlertmanager) ApplyConfig(ctx context.Context, c
|
||||||
}
|
}
|
||||||
fam.log.Debug("Finished syncing configuration with the remote Alertmanager")
|
fam.log.Debug("Finished syncing configuration with the remote Alertmanager")
|
||||||
}
|
}
|
||||||
}()
|
}(wg)
|
||||||
|
|
||||||
if fam.shouldFetchRemoteState {
|
if fam.shouldFetchRemoteState {
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
Loading…
Reference in New Issue