Skip to content

Commit befca2d

Browse files
committed
feat: Timeout
1 parent fe0853a commit befca2d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/app/server/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"os/signal"
1111
"syscall"
12+
"time"
1213

1314
. "routes"
1415

@@ -167,7 +168,10 @@ func (app *App) Run() error {
167168
httpPort := viper.GetString("http.port")
168169
app.logger.Infof("Serving gRPC-Gateway with FastHTTP on https://0.0.0.0%s", httpPort)
169170
httpServer := &fasthttp.Server{
170-
Handler: app.RegisterMux(),
171+
Handler: app.RegisterMux(),
172+
ReadTimeout: 5 * time.Second,
173+
WriteTimeout: 10 * time.Second,
174+
IdleTimeout: 60 * time.Second,
171175
}
172176

173177
// Run FastHTTP server in a separate goroutine.

0 commit comments

Comments
 (0)