You've already forked imgproxy
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:
13
server.go
13
server.go
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user