mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
override binance default http client timeout instead of zero timeout
This commit is contained in:
parent
513a799ced
commit
4bde40f2db
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"github.com/adshao/go-binance/v2/futures"
|
||||
"golang.org/x/time/rate"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -50,6 +51,8 @@ type Exchange struct {
|
|||
|
||||
func New(key, secret string) *Exchange {
|
||||
var client = binance.NewClient(key, secret)
|
||||
client.HTTPClient = &http.Client{Timeout: 15 * time.Second}
|
||||
|
||||
_, _ = client.NewSetServerTimeService().Do(context.Background())
|
||||
return &Exchange{
|
||||
key: key,
|
||||
|
|
Loading…
Reference in New Issue
Block a user