mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-01-18 11:12:10 +02:00
Move health response before semaphore
This commit is contained in:
parent
05f6412329
commit
c03a9c69c3
12
server.go
12
server.go
@ -212,6 +212,12 @@ func (h *httpHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||
panic(errInvalidSecret)
|
||||
}
|
||||
|
||||
if r.URL.RequestURI() == healthPath {
|
||||
rw.WriteHeader(200)
|
||||
rw.Write(imgproxyIsRunningMsg)
|
||||
return
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
if newRelicEnabled {
|
||||
@ -228,12 +234,6 @@ func (h *httpHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||
h.lock()
|
||||
defer h.unlock()
|
||||
|
||||
if r.URL.RequestURI() == healthPath {
|
||||
rw.WriteHeader(200)
|
||||
rw.Write(imgproxyIsRunningMsg)
|
||||
return
|
||||
}
|
||||
|
||||
ctx, timeoutCancel := startTimer(ctx, time.Duration(conf.WriteTimeout)*time.Second)
|
||||
defer timeoutCancel()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user