Skip to content

Commit

Permalink
timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
icco committed Dec 20, 2024
1 parent 25dc957 commit 58e9489
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"net/url"
"os"
"time"

"github.com/AlecAivazis/survey/v2"
"github.com/AlecAivazis/survey/v2/terminal"
Expand Down Expand Up @@ -83,8 +84,10 @@ func Serve() error {
log.Infow("Starting up", "host", fmt.Sprintf("http://localhost:%s", port))

srv := &http.Server{
Addr: ":" + port,
Handler: router,
Addr: ":" + port,
Handler: router,
ReadTimeout: 1 * time.Second,
WriteTimeout: 1 * time.Second,
}

return srv.ListenAndServe()
Expand Down

0 comments on commit 58e9489

Please sign in to comment.