use a different db handle for dry_run
This commit is contained in:
parent
5402f8ba30
commit
bc8f00009d
2
main.py
2
main.py
@ -24,7 +24,7 @@ from utils import get_conf
|
||||
__author__ = "gcarq"
|
||||
__copyright__ = "gcarq 2017"
|
||||
__license__ = "GPLv3"
|
||||
__version__ = "0.6.1"
|
||||
__version__ = "0.7.0"
|
||||
|
||||
|
||||
conf = get_conf()
|
||||
|
@ -6,11 +6,16 @@ from sqlalchemy.orm import scoped_session, sessionmaker
|
||||
from sqlalchemy.types import Enum
|
||||
|
||||
from exchange import Exchange
|
||||
from utils import get_conf
|
||||
|
||||
if get_conf().get('dry_run', False):
|
||||
db_handle = 'sqlite:///tradesv2.dry_run.sqlite'
|
||||
else:
|
||||
db_handle = 'sqlite:///tradesv2.sqlite'
|
||||
|
||||
Base = declarative_base()
|
||||
engine = create_engine('sqlite:///tradesv2.sqlite', echo=False)
|
||||
engine = create_engine(db_handle, echo=False)
|
||||
Session = scoped_session(sessionmaker(bind=engine, autoflush=True, autocommit=True))
|
||||
Base = declarative_base()
|
||||
|
||||
|
||||
class Trade(Base):
|
||||
|
Loading…
Reference in New Issue
Block a user