Update sqlite init method

This commit is contained in:
Matthias 2021-05-23 08:56:41 +02:00
parent b82f7a2dfd
commit 66de5df1d1

View File

@ -38,12 +38,14 @@ def init_db(db_url: str, clean_open_orders: bool = False) -> None:
""" """
kwargs = {} kwargs = {}
# Take care of thread ownership if in-memory db
if db_url == 'sqlite://': if db_url == 'sqlite://':
kwargs.update({ kwargs.update({
'connect_args': {'check_same_thread': False},
'poolclass': StaticPool, 'poolclass': StaticPool,
'echo': False, })
# Take care of thread ownership
if db_url.startswith('sqlite://'):
kwargs.update({
'connect_args': {'check_same_thread': False},
}) })
try: try: