File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1- // Copyright 2024 Blink Labs Software
1+ // Copyright 2025 Blink Labs Software
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import (
2020 "encoding/hex"
2121 "fmt"
2222 "io"
23+ "math"
2324 "net/http"
2425 "net/http/httptrace"
2526 "strings"
@@ -275,8 +276,12 @@ func handleSubmitTx(c *gin.Context) {
275276
276277// createHTTPClient with custom timeout
277278func createHTTPClient (cfg * config.Config ) * http.Client {
279+ timeout := int64 (60000 )
280+ if cfg .Api .ClientTimeout < math .MaxInt64 {
281+ timeout = int64 (cfg .Api .ClientTimeout ) // #nosec G115
282+ }
278283 return & http.Client {
279- Timeout : time .Duration (cfg . Api . ClientTimeout ) * time .Millisecond ,
284+ Timeout : time .Duration (timeout ) * time .Millisecond ,
280285 Transport : & http.Transport {
281286 MaxIdleConns : 100 ,
282287 IdleConnTimeout : 90 * time .Second ,
You can’t perform that action at this time.
0 commit comments