mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
use environment to configure database
This commit is contained in:
parent
2a524c0505
commit
d96e6e8ccc
|
@ -115,6 +115,11 @@ var BacktestCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
|
||||
environ := bbgo.NewEnvironment()
|
||||
if err := environ.ConfigureDatabase(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
backtestService := &service.BacktestService{DB: db}
|
||||
|
||||
if wantSync {
|
||||
|
@ -178,7 +183,6 @@ var BacktestCmd = &cobra.Command{
|
|||
|
||||
backtestExchange := backtest.NewExchange(exchangeName, backtestService, userConfig.Backtest)
|
||||
|
||||
environ := bbgo.NewEnvironment()
|
||||
environ.SetStartTime(startTime)
|
||||
environ.AddExchange(exchangeName.String(), backtestExchange)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user