Skip to content

Commit c0aa8a2

Browse files
committed
Timeout update
1 parent cf41610 commit c0aa8a2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cmd/filer/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Globals struct {
2727
HTTP struct {
2828
Prefix string `name:"prefix" help:"HTTP path prefix" default:"/api/filer"`
2929
Addr string `name:"addr" env:"FILER_ADDR" help:"HTTP listen address" default:"localhost:8087"`
30-
Timeout time.Duration `name:"timeout" help:"HTTP request timeout" default:"30s"`
30+
Timeout time.Duration `name:"timeout" help:"HTTP request timeout" default:"30m"`
3131
Origin string `name:"origin" help:"CORS origin ('*' to allow all, empty for same-origin only)" default:""`
3232
} `embed:"" prefix:"http."`
3333

cmd/filer/server.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ func serve(ctx *Globals, mgr *manager.Manager) error {
174174
}
175175

176176
// Create and run the HTTP server
177-
srv, err := httpserver.New(ctx.HTTP.Addr, http.Handler(router), nil)
177+
srv, err := httpserver.New(ctx.HTTP.Addr, http.Handler(router), nil,
178+
httpserver.WithReadTimeout(ctx.HTTP.Timeout),
179+
httpserver.WithWriteTimeout(ctx.HTTP.Timeout),
180+
)
178181
if err != nil {
179182
return fmt.Errorf("failed to create server: %w", err)
180183
}

0 commit comments

Comments
 (0)