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
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import (
20
20
"encoding/hex"
21
21
"fmt"
22
22
"io"
23
+ "math"
23
24
"net/http"
24
25
"net/http/httptrace"
25
26
"strings"
@@ -275,8 +276,12 @@ func handleSubmitTx(c *gin.Context) {
275
276
276
277
// createHTTPClient with custom timeout
277
278
func 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
+ }
278
283
return & http.Client {
279
- Timeout : time .Duration (cfg . Api . ClientTimeout ) * time .Millisecond ,
284
+ Timeout : time .Duration (timeout ) * time .Millisecond ,
280
285
Transport : & http.Transport {
281
286
MaxIdleConns : 100 ,
282
287
IdleConnTimeout : 90 * time .Second ,
You can’t perform that action at this time.
0 commit comments