mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-29 06:46:23 +02:00
add support for per-request timeout
Adds a -timeout flag for specifying the timeout. Currently, this returns a 503 response on timeout, though it should really be a 504, since imageproxy is acting as a gateway. Ref: #75
This commit is contained in:
parent
94dbd77d6e
commit
93166a5b20
2 changed files with 17 additions and 1 deletions
|
|
@ -49,6 +49,7 @@ var cacheDir = flag.String("cacheDir", "", "(Deprecated; use 'cache' instead) di
|
|||
var cacheSize = flag.Uint64("cacheSize", 0, "Deprecated: this flag does nothing")
|
||||
var signatureKey = flag.String("signatureKey", "", "HMAC key used in calculating request signatures")
|
||||
var scaleUp = flag.Bool("scaleUp", false, "allow images to scale beyond their original dimensions")
|
||||
var timeout = flag.Duration("timeout", 0, "time limit for requests served by this proxy")
|
||||
var version = flag.Bool("version", false, "print version information")
|
||||
|
||||
func main() {
|
||||
|
|
@ -91,6 +92,7 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
p.Timeout = *timeout
|
||||
p.ScaleUp = *scaleUp
|
||||
|
||||
server := &http.Server{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue