mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-13 09:34:38 +00:00
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.
|
||||
func (r *InhibitRule) set(a *types.Alert) {
|
||||
r.mtx.Lock()
|
||||
r.mtx.Unlock()
|
||||
defer r.mtx.Unlock()
|
||||
|
||||
r.scache[a.Fingerprint()] = a
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user