Simplify database locking

Use a single lock for everything to ensure we don’t go inconsistent.
One exception is the firewall nodes table which is only accessed when
pushing updated config.
This commit is contained in:
Timotej Lazar 2023-05-19 09:30:28 +02:00
parent 93458c4782
commit 22cec64bef
5 changed files with 19 additions and 18 deletions

View file

@ -28,7 +28,7 @@ def create_app(test_config=None):
}
from . import db
with db.locked('settings'):
with db.locked():
settings |= db.read('settings')
db.write('settings', settings)