inhibitrule: defer Unlock to fix race

This commit is contained in:
Carl Henrik Lunde 2016-10-08 22:07:29 +02:00
parent 97acef1819
commit 2935ff84e7
1 changed files with 1 additions and 1 deletions

View File

@ -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
}