|
@@ -8,10 +8,11 @@ import (
|
|
type timer struct {
|
|
type timer struct {
|
|
StartTime time.Time
|
|
StartTime time.Time
|
|
Timer <-chan time.Time
|
|
Timer <-chan time.Time
|
|
|
|
+ Info string
|
|
}
|
|
}
|
|
|
|
|
|
-func startTimer(dt time.Duration) *timer {
|
|
|
|
- return &timer{time.Now(), time.After(dt)}
|
|
|
|
|
|
+func startTimer(dt time.Duration, info string) *timer {
|
|
|
|
+ return &timer{time.Now(), time.After(dt), info}
|
|
}
|
|
}
|
|
|
|
|
|
func (t *timer) Check() {
|
|
func (t *timer) Check() {
|
|
@@ -24,7 +25,7 @@ func (t *timer) Check() {
|
|
}
|
|
}
|
|
|
|
|
|
func (t *timer) TimeoutErr() imgproxyError {
|
|
func (t *timer) TimeoutErr() imgproxyError {
|
|
- return newError(503, fmt.Sprintf("Timeout after %v", t.Since()), "Timeout")
|
|
|
|
|
|
+ return newError(503, fmt.Sprintf("Timeout after %v (%s)", t.Since(), t.Info), "Timeout")
|
|
}
|
|
}
|
|
|
|
|
|
func (t *timer) Since() time.Duration {
|
|
func (t *timer) Since() time.Duration {
|