Transactions.

This commit is contained in:
retoor 2025-03-27 21:01:17 +01:00
parent 9d5815ed10
commit 8810679fd8

View File

@ -81,10 +81,12 @@ class Application(BaseApplication):
async def task_runner(self):
while True:
task = await self.tasks.get()
self.db.begin()
try:
await task
except Exception as ex:
print(ex)
self.db.commit()
async def prepare_database(self,app):
self.db.query("PRAGMA journal_mode=WAL")