]> git.ipfire.org Git - ipfire.org.git/commitdiff
backend: Wrap all tasks into a transaction
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 26 Nov 2024 16:45:27 +0000 (16:45 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 26 Nov 2024 16:45:27 +0000 (16:45 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/base.py

index 5927591047bfa75f138214afd68f57c553f5a980..c7b4fd02df0d771c5de82a36467014aaf202dec5 100644 (file)
@@ -185,7 +185,8 @@ class Backend(object):
                        return
 
                # Run the task
-               r = await func(*args, **kwargs)
+               with self.db.transaction():
+                       r = await func(*args, **kwargs)
 
                # If any error code has been returned,
                # we will end the program