engine: Adds shutdown method to exchange manager and unload all exchanges when engine is stopped (#1112)

* engine: shutdown and unload exchange when engine is stopped

* linter: fixes

* engine/exchMan: add nil check

* engine/exchanges: add shutdown method to exchanges, rm len check lock not needed, expanded code coverage, address some nits

* exchMan: report all failed shutdowns across exchanges, implement timer and monitoring routines.

* exchMan: improve shutdown sequence and aloc.

* further improvement

* exchman: log from warn to error

* websockconnection: Suppress error return when closure is caused by library

* linter: fix

* fix racies

* add note on why not parallel tests

* glorious: nits

* spelling kween

* thrasher: nits

* engine: change print of setting using reflection, I keep forgetting to implement this so program around forgetfulness

* engine/exchange_management: remove wait group and just rely on intermediary lock

* glorious: nits

* Update common/common.go

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

* Update main.go

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
This commit is contained in:
Ryan O'Hara-Reid
2023-04-05 13:07:35 +10:00
committed by GitHub
parent 4a50a72e4a
commit d23898e63a
35 changed files with 803 additions and 356 deletions

View File

@@ -21,12 +21,14 @@ func main() {
}
engine.Bot.Settings = engine.Settings{
DisableExchangeAutoPairUpdates: true,
EnableDryRun: true,
CoreSettings: engine.CoreSettings{EnableDryRun: true},
ExchangeTuningSettings: engine.ExchangeTuningSettings{
DisableExchangeAutoPairUpdates: true,
},
}
engine.Bot.Config.PurgeExchangeAPICredentials()
engine.Bot.ExchangeManager = engine.SetupExchangeManager()
engine.Bot.ExchangeManager = engine.NewExchangeManager()
log.Printf("Loading exchanges..")
var wg sync.WaitGroup