fix: in printEndpointError count error once per init() (#17193)

This commit is contained in:
jiuker 2023-05-13 01:41:54 +08:00 committed by GitHub
parent 883c98e26f
commit 203755793c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,9 +44,9 @@ var printEndpointError = func() func(Endpoint, error, bool) {
m, ok := printOnce[endpoint]
if !ok {
m = make(map[string]int)
m[err.Error()]++
printOnce[endpoint] = m
if once {
m[err.Error()]++
logger.LogAlwaysIf(ctx, err)
return
}