diff --git a/inhibit/inhibit.go b/inhibit/inhibit.go index 0f5a936c..fe50a0f6 100644 --- a/inhibit/inhibit.go +++ b/inhibit/inhibit.go @@ -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 }