Add more timeouts

This commit is contained in:
Geoff Stuart
2022-11-25 16:24:09 -05:00
parent b55e121642
commit d2b7c3889b
5 changed files with 10 additions and 5 deletions
+3 -1
View File
@@ -6,6 +6,7 @@ import (
"net"
"net/http"
"os"
"time"
"github.com/gbrlsnchs/jwt/v3"
"github.com/gorilla/mux"
@@ -240,7 +241,8 @@ var runCmd = &cli.Command{
}
srv := &http.Server{
Handler: handler,
Handler: handler,
ReadHeaderTimeout: 3 * time.Second,
BaseContext: func(listener net.Listener) context.Context {
ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, "lotus-wallet"))
return ctx
+2 -1
View File
@@ -563,7 +563,8 @@ var runCmd = &cli.Command{
log.Info("Setting up control endpoint at " + address)
srv := &http.Server{
Handler: sealworker.WorkerHandler(nodeApi.AuthVerify, remoteHandler, workerApi, true),
Handler: sealworker.WorkerHandler(nodeApi.AuthVerify, remoteHandler, workerApi, true),
ReadHeaderTimeout: 3 * time.Second,
BaseContext: func(listener net.Listener) context.Context {
ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, "lotus-worker"))
return ctx