Update sqlite init method
This commit is contained in:
parent
b82f7a2dfd
commit
66de5df1d1
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user