From a2b2e0fe3429325c3343843f375bee7b052e46e4 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Sun, 12 Dec 2021 13:21:07 +0100 Subject: [PATCH] daemon/control: make http server {Read,Write}Timeout envconst-configurable refs https://github.com/zrepl/zrepl/issues/379 --- daemon/control.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/control.go b/daemon/control.go index 81362ee..45bddb7 100644 --- a/daemon/control.go +++ b/daemon/control.go @@ -158,8 +158,8 @@ func (j *controlJob) Run(ctx context.Context) { server := http.Server{ Handler: mux, // control socket is local, 1s timeout should be more than sufficient, even on a loaded system - WriteTimeout: 1 * time.Second, - ReadTimeout: 1 * time.Second, + WriteTimeout: envconst.Duration("ZREPL_DAEMON_CONTROL_SERVER_WRITE_TIMEOUT", 1*time.Second), + ReadTimeout: envconst.Duration("ZREPL_DAEMON_CONTROL_SERVER_READ_TIMEOUT", 1*time.Second), } outer: