Merge pull request #2016 from mattbostock/fix_race_between_reload_and_stop
rules/manager.go: Fix race between reload and stop
This commit is contained in:
commit
5e57fa85c0
|
@ -365,6 +365,9 @@ func (m *Manager) Run() {
|
||||||
|
|
||||||
// Stop the rule manager's rule evaluation cycles.
|
// Stop the rule manager's rule evaluation cycles.
|
||||||
func (m *Manager) Stop() {
|
func (m *Manager) Stop() {
|
||||||
|
m.mtx.Lock()
|
||||||
|
defer m.mtx.Unlock()
|
||||||
|
|
||||||
log.Info("Stopping rule manager...")
|
log.Info("Stopping rule manager...")
|
||||||
|
|
||||||
for _, eg := range m.groups {
|
for _, eg := range m.groups {
|
||||||
|
|
Loading…
Reference in New Issue