all: imp code
This commit is contained in:
parent
022c90496a
commit
45b2fc6a05
|
@ -57,11 +57,13 @@ func ErrorAndLog(
|
|||
l.ErrorContext(
|
||||
ctx,
|
||||
"http error",
|
||||
"method", r.Method,
|
||||
"host", r.Host,
|
||||
"url", r.URL,
|
||||
"method", r.Method,
|
||||
"raddr", r.RemoteAddr,
|
||||
"request_uri", r.RequestURI,
|
||||
slogutil.KeyError, text,
|
||||
)
|
||||
|
||||
http.Error(w, text, code)
|
||||
}
|
||||
|
||||
|
|
|
@ -466,13 +466,13 @@ func (s *StatsCtx) flushDB(id, limit uint32, ptr *unit) (cont bool, sleepFor tim
|
|||
if delErr != nil {
|
||||
// TODO(e.burkov): Improve the algorithm of deleting the oldest bucket
|
||||
// to avoid the error.
|
||||
logFunc := s.logger.Warn
|
||||
lvl := slog.LevelWarn
|
||||
if !errors.Is(delErr, bbolt.ErrBucketNotFound) {
|
||||
isCommitable = false
|
||||
logFunc = s.logger.Error
|
||||
lvl = slog.LevelError
|
||||
}
|
||||
|
||||
logFunc("deleting bucket", slogutil.KeyError, delErr)
|
||||
s.logger.Log(context.TODO(), lvl, "deleting bucket", slogutil.KeyError, delErr)
|
||||
}
|
||||
|
||||
return true, 0
|
||||
|
|
Loading…
Reference in New Issue