diff --git a/helpers/general.go b/helpers/general.go index cf87c04b1..48e7dbd01 100644 --- a/helpers/general.go +++ b/helpers/general.go @@ -162,11 +162,12 @@ type DistinctErrorLogger struct { func (l *DistinctErrorLogger) Printf(format string, v ...interface{}) { logStatement := fmt.Sprintf(format, v...) l.RLock() - logged := l.m[logStatement] - l.RUnlock() - if logged { + if l.m[logStatement] { + l.RUnlock() return } + l.RUnlock() + l.Lock() if !l.m[logStatement] { jww.ERROR.Print(logStatement)