inhibitrule: defer Unlock to fix race
This commit is contained in:
parent
97acef1819
commit
2935ff84e7
|
@ -184,7 +184,7 @@ func NewInhibitRule(cr *config.InhibitRule) *InhibitRule {
|
||||||
// set the alert in the source cache.
|
// set the alert in the source cache.
|
||||||
func (r *InhibitRule) set(a *types.Alert) {
|
func (r *InhibitRule) set(a *types.Alert) {
|
||||||
r.mtx.Lock()
|
r.mtx.Lock()
|
||||||
r.mtx.Unlock()
|
defer r.mtx.Unlock()
|
||||||
|
|
||||||
r.scache[a.Fingerprint()] = a
|
r.scache[a.Fingerprint()] = a
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue