From 53168d54d803ef0c4a182ed6457a95e5681657e7 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Thu, 19 Aug 2021 22:29:03 +0100 Subject: [PATCH] Make http timeout 30s instead of 10s --- app.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app.go b/app.go index 76cf92ea..fe1b954b 100644 --- a/app.go +++ b/app.go @@ -167,14 +167,16 @@ func (h *Headscale) Serve() error { r.POST("/machine/:id", h.RegistrationHandler) var err error + timeout := 30 * time.Second + go h.watchForKVUpdates(5000) go h.expireEphemeralNodes(5000) s := &http.Server{ Addr: h.cfg.Addr, Handler: r, - ReadTimeout: 10 * time.Second, - WriteTimeout: 10 * time.Second, + ReadTimeout: timeout, + WriteTimeout: timeout, } if h.cfg.TLSLetsEncryptHostname != "" { @@ -191,8 +193,8 @@ func (h *Headscale) Serve() error { Addr: h.cfg.Addr, TLSConfig: m.TLSConfig(), Handler: r, - ReadTimeout: 10 * time.Second, - WriteTimeout: 10 * time.Second, + ReadTimeout: timeout, + WriteTimeout: timeout, } if h.cfg.TLSLetsEncryptChallengeType == "TLS-ALPN-01" { // Configuration via autocert with TLS-ALPN-01 (https://tools.ietf.org/html/rfc8737)