Skip to content

Commit 0fdc43c

Browse files
authored
server writeTimeout from loki one (#446)
1 parent 49c33d4 commit 0fdc43c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/server/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,15 @@ func Start(cfg *Config, authChecker auth.Checker) {
3131
router := setupRoutes(cfg, authChecker)
3232
router.Use(corsHeader(cfg))
3333

34+
writeTimeout := 30 * time.Second
35+
if cfg.Loki.Timeout.Seconds() > writeTimeout.Seconds() {
36+
writeTimeout = cfg.Loki.Timeout
37+
}
38+
3439
httpServer := defaultServer(&http.Server{
3540
Handler: router,
3641
Addr: fmt.Sprintf(":%d", cfg.Port),
37-
WriteTimeout: 30 * time.Second,
42+
WriteTimeout: writeTimeout,
3843
})
3944

4045
if cfg.CertPath != "" && cfg.KeyPath != "" {

0 commit comments

Comments
 (0)