mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 07:26:47 +00:00
tool/exchange_wrapper_coverage: fix regression and implement reflection (#837)
* cmd/tools/exchange: fix regression and implement reflection so as this can dynamically scale to our interface * exchanges: add comment and fix whoopsie * exchanges: fix linter issues * wrapper_cov_tool: add actual full interface method count to get a better perceived deployment * exchanges/tool: addr glorious nits * kraken: remove string in test * exchange_template_tool: fix tmpl issue
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/thrasher-corp/gocryptotrader/common"
|
||||
"github.com/thrasher-corp/gocryptotrader/database"
|
||||
dbpsql "github.com/thrasher-corp/gocryptotrader/database/drivers/postgres"
|
||||
dbsqlite3 "github.com/thrasher-corp/gocryptotrader/database/drivers/sqlite3"
|
||||
@@ -68,6 +69,9 @@ func (m *DatabaseConnectionManager) IsConnected() bool {
|
||||
|
||||
// Start sets up the database connection manager to maintain a SQL connection
|
||||
func (m *DatabaseConnectionManager) Start(wg *sync.WaitGroup) (err error) {
|
||||
if wg == nil {
|
||||
return fmt.Errorf("%T %w", wg, common.ErrNilPointer)
|
||||
}
|
||||
if m == nil {
|
||||
return fmt.Errorf("%s %w", DatabaseConnectionManagerName, ErrNilSubsystem)
|
||||
}
|
||||
|
||||
@@ -861,13 +861,15 @@ func (bot *Engine) LoadExchange(name string, wg *sync.WaitGroup) error {
|
||||
}
|
||||
|
||||
if wg != nil {
|
||||
exch.Start(wg)
|
||||
} else {
|
||||
tempWG := sync.WaitGroup{}
|
||||
exch.Start(&tempWG)
|
||||
tempWG.Wait()
|
||||
return exch.Start(wg)
|
||||
}
|
||||
|
||||
tempWG := sync.WaitGroup{}
|
||||
err = exch.Start(&tempWG)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tempWG.Wait()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user