refactor: minor changes.
This commit is contained in:
parent
f1a257abf8
commit
8235cd3645
2 changed files with 4 additions and 2 deletions
|
@ -80,7 +80,7 @@ func (r *responseRecorder) Flush() {
|
|||
func (s *StatsRecorder) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
|
||||
recorder := &responseRecorder{w, http.StatusOK}
|
||||
next(recorder, r)
|
||||
if recorder.statusCode >= 400 {
|
||||
if recorder.statusCode >= http.StatusBadRequest {
|
||||
s.mutex.Lock()
|
||||
defer s.mutex.Unlock()
|
||||
s.recentErrors = append([]*statsError{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue