From 8810679fd8ea2dd6e63b09bf9a4b9af5c2d0fdd2 Mon Sep 17 00:00:00 2001
From: retoor <retoor@molodetz.nl>
Date: Thu, 27 Mar 2025 21:01:17 +0100
Subject: [PATCH] Transactions.

---
 src/snek/app.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/snek/app.py b/src/snek/app.py
index 7c0f0b0..67beb5d 100644
--- a/src/snek/app.py
+++ b/src/snek/app.py
@@ -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")