remove dry_run_db and replace it with db_url in config

This commit is contained in:
gcarq
2018-06-07 05:26:39 +02:00
parent 8583e89550
commit 58a6f21705
3 changed files with 26 additions and 23 deletions

View File

@@ -97,16 +97,21 @@ class Configuration(object):
'(not applicable with Backtesting and Hyperopt)'
)
# Add dry_run_db if found and the bot in dry run
if self.args.dry_run_db and config.get('dry_run', False):
config.update({'dry_run_db': True})
logger.info('Parameter --dry-run-db detected ...')
if self.args.db_url and config.get('db_url', None):
config.update({'db_url': self.args.db_url})
logger.info('Parameter --db-url detected ...')
if config.get('dry_run_db', False):
if config.get('dry_run', False):
logger.info('Dry_run will use the DB file: "tradesv3.dry_run.sqlite"')
else:
logger.info('Dry run is disabled. (--dry_run_db ignored)')
if config.get('dry_run', False):
logger.info('Dry run is enabled')
if config.get('db_url') in [None, constants.DEFAULT_DB_URL]:
# Default to in-memory db for dry_run if not specified
config['db_url'] = 'sqlite://'
else:
if not config.get('db_url', None):
config['db_url'] = constants.DEFAULT_DB_URL
logger.info('Dry run is disabled')
logger.info('Using DB: "{}"'.format(config['db_url']))
# Check if the exchange set by the user is supported
self.check_exchange(config)