Skip to content

Commit

Permalink
throw error on startup when FILL_TRACKER_SLEEP_MILLIS is not set but …
Browse files Browse the repository at this point in the history
…POSTGRES_DB is set (closes stellar-deprecated#370)
  • Loading branch information
nikhilsaraf committed Feb 15, 2020
1 parent 53691b9 commit 99799da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/trade.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ func runTradeCmd(options inputs) {

var db *sql.DB
if botConfig.PostgresDbConfig != nil {
if botConfig.FillTrackerSleepMillis == 0 {
log.Println()
utils.PrintErrorHintf("FILL_TRACKER_SLEEP_MILLIS needs to be set in the trader.cfg file when the POSTGRES_DB is enabled so we can fetch trades to be saved in the db")
logger.Fatal(l, fmt.Errorf("invalid trader.cfg config, need to set FILL_TRACKER_SLEEP_MILLIS"))
}

var e error
db, e = database.ConnectInitializedDatabase(botConfig.PostgresDbConfig)
if e != nil {
Expand Down

0 comments on commit 99799da

Please sign in to comment.