Always set check_same_thread=False in case of SQLite engines.
Platypush is heavily multi-threaded, and it can happen that some transactions are handled in different threads - and consistency is managed by the application itself.
This commit is contained in:
parent
6ba92e7fdd
commit
0ced46058a
1 changed files with 2 additions and 0 deletions
|
@ -39,6 +39,8 @@ class DbPlugin(Plugin):
|
||||||
if engine:
|
if engine:
|
||||||
if isinstance(engine, Engine):
|
if isinstance(engine, Engine):
|
||||||
return engine
|
return engine
|
||||||
|
if engine.startswith('sqlite://'):
|
||||||
|
kwargs['connect_args'] = {'check_same_thread': False}
|
||||||
|
|
||||||
return create_engine(engine, *args, **kwargs)
|
return create_engine(engine, *args, **kwargs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue