mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
cmd/wrapper_coverage: prevent non-needed REST requests via context timeout (#1154)
* wrapper_coverage/exchanges: cancel context to not send rest requests/ populate context through functions that do rest requests * linter: fix * exchange_template: fix test --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -888,11 +888,11 @@ func (bot *Engine) LoadExchange(name string, wg *sync.WaitGroup) error {
|
||||
}
|
||||
|
||||
if wg != nil {
|
||||
return exch.Start(wg)
|
||||
return exch.Start(context.TODO(), wg)
|
||||
}
|
||||
|
||||
tempWG := sync.WaitGroup{}
|
||||
err = exch.Start(&tempWG)
|
||||
err = exch.Start(context.TODO(), &tempWG)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ func OrdersSetup(t *testing.T) *OrderManager {
|
||||
}
|
||||
exch.SetDefaults()
|
||||
|
||||
cfg, err := exch.GetDefaultConfig()
|
||||
cfg, err := exch.GetDefaultConfig(context.Background())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ func withdrawManagerTestHelper(t *testing.T) (*ExchangeManager, *portfolioManage
|
||||
em := SetupExchangeManager()
|
||||
b := new(bybit.Bybit)
|
||||
b.SetDefaults()
|
||||
cfg, err := b.GetDefaultConfig()
|
||||
cfg, err := b.GetDefaultConfig(context.Background())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user