Commit ecec37a2 authored by Alessio Caiazza's avatar Alessio Caiazza

Merge branch '311-dont-log-success-for-failovers' into 'master'

Don't log "success" when failing over to original image

Closes #311

See merge request gitlab-org/gitlab-workhorse!636
parents 9b8d7b7e 8fc9bfcf
---
title: Don't log image scaler fail-overs as successes
merge_request: 636
author:
type: fixed
......@@ -174,11 +174,15 @@ func (r *Resizer) Inject(w http.ResponseWriter, req *http.Request, paramsData st
return
}
if resizeCmd != nil {
widthLabelVal := strconv.Itoa(int(params.Width))
imageResizeDurations.WithLabelValues(params.ContentType, widthLabelVal).Observe(time.Since(start).Seconds())
if resizeCmd == nil {
// This means we served the original image because rescaling failed
logger.WithFields(*logFields(bytesWritten)).Printf("ImageResizer: Served original")
return
}
widthLabelVal := strconv.Itoa(int(params.Width))
imageResizeDurations.WithLabelValues(params.ContentType, widthLabelVal).Observe(time.Since(start).Seconds())
logger.WithFields(*logFields(bytesWritten)).Printf("ImageResizer: Success")
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment