Skip to content

Commit 85c7920

Browse files
committed
rosetta server fix
1 parent f1db391 commit 85c7920

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cmd/rosetta/main.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"log"
66
"net/http"
7+
"time"
78

89
"github.com/CortexFoundation/rosetta-cortex/router"
910
"github.com/coinbase/rosetta-sdk-go/asserter"
@@ -44,5 +45,13 @@ func main() {
4445
corsRouter := server.CorsMiddleware(loggedRouter)
4546

4647
log.Printf("Listening on port %d\n", serverPort)
47-
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", serverPort), corsRouter))
48+
srv := &http.Server{
49+
Addr: fmt.Sprintf(":%d", serverPort),
50+
Handler: corsRouter,
51+
ReadTimeout: 5 * time.Second,
52+
WriteTimeout: 10 * time.Second,
53+
IdleTimeout: 15 * time.Second,
54+
}
55+
56+
log.Fatal(srv.ListenAndServe())
4857
}

0 commit comments

Comments
 (0)