Transactions.
This commit is contained in:
parent
9d5815ed10
commit
8810679fd8
@ -81,10 +81,12 @@ class Application(BaseApplication):
|
|||||||
async def task_runner(self):
|
async def task_runner(self):
|
||||||
while True:
|
while True:
|
||||||
task = await self.tasks.get()
|
task = await self.tasks.get()
|
||||||
|
self.db.begin()
|
||||||
try:
|
try:
|
||||||
await task
|
await task
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print(ex)
|
print(ex)
|
||||||
|
self.db.commit()
|
||||||
|
|
||||||
async def prepare_database(self,app):
|
async def prepare_database(self,app):
|
||||||
self.db.query("PRAGMA journal_mode=WAL")
|
self.db.query("PRAGMA journal_mode=WAL")
|
||||||
|
Loading…
Reference in New Issue
Block a user