mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
Return early from DistinctErrorLogger's Printf
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user