mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 16:14:59 +00:00
Return early from DistinctErrorLogger's Printf
This commit is contained in:
1 parent
99a18b21fc
commit
bea5feb34d
1 file changed
+4
-3
+4
-3
@@ -162,11 +162,12 @@ type DistinctErrorLogger struct {
|
|||||||
func (l *DistinctErrorLogger) Printf(format string, v ...interface{}) {
|
func (l *DistinctErrorLogger) Printf(format string, v ...interface{}) {
|
||||||
logStatement := fmt.Sprintf(format, v...)
|
logStatement := fmt.Sprintf(format, v...)
|
||||||
l.RLock()
|
l.RLock()
|
||||||
logged := l.m[logStatement]
|
if l.m[logStatement] {
|
||||||
l.RUnlock()
|
l.RUnlock()
|
||||||
if logged {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
l.RUnlock()
|
||||||
|
|
||||||
l.Lock()
|
l.Lock()
|
||||||
if !l.m[logStatement] {
|
if !l.m[logStatement] {
|
||||||
jww.ERROR.Print(logStatement)
|
jww.ERROR.Print(logStatement)
|
||||||
|
|||||||
Reference in new issue
Block a user