mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
chore: rename search route prefix (#887)
* chore: rename search route prefix * chore: use builtin time.Duration.Truncate() on latencies Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
+2
-4
@@ -83,10 +83,8 @@ func SessionLogger(ctlr *Controller) mux.MiddlewareFunc {
|
||||
// Stop timer
|
||||
end := time.Now()
|
||||
latency := end.Sub(start)
|
||||
if latency > time.Minute {
|
||||
// Truncate in a golang < 1.8 safe way
|
||||
latency -= latency % time.Second
|
||||
}
|
||||
latency = latency.Truncate(time.Second)
|
||||
|
||||
clientIP := request.RemoteAddr
|
||||
method := request.Method
|
||||
headers := map[string][]string{}
|
||||
|
||||
Reference in New Issue
Block a user