1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-11-29 23:07:40 +02:00

Remove wait timeout

This commit is contained in:
DarthSim
2018-03-19 14:58:52 +06:00
parent 9ba634fc35
commit f6fa71810e
3 changed files with 5 additions and 19 deletions

View File

@@ -144,14 +144,7 @@ func checkSecret(s string) bool {
}
func (h *httpHandler) lock() {
t := startTimer(time.Duration(conf.WaitTimeout)*time.Second, "Waiting")
select {
case h.sem <- struct{}{}:
// Go ahead
case <-t.Timer:
panic(t.TimeoutErr())
}
h.sem <- struct{}{}
}
func (h *httpHandler) unlock() {
@@ -177,8 +170,6 @@ func (h *httpHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
panic(invalidSecretErr)
}
t := startTimer(time.Duration(conf.WriteTimeout)*time.Second, "Processing")
h.lock()
defer h.unlock()
@@ -188,6 +179,8 @@ func (h *httpHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
return
}
t := startTimer(time.Duration(conf.WriteTimeout)*time.Second, "Processing")
imgURL, procOpt, err := parsePath(r)
if err != nil {
panic(newError(404, err.Error(), "Invalid image url"))