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:
parent
93458c4782
commit
22cec64bef
5 changed files with 19 additions and 18 deletions
|
@ -14,7 +14,7 @@ def index():
|
|||
try:
|
||||
if not flask_login.current_user.is_admin:
|
||||
return flask.Response('forbidden', status=403, mimetype='text/plain')
|
||||
with db.locked('settings'):
|
||||
with db.locked():
|
||||
if flask.request.method == 'POST':
|
||||
form = flask.request.form
|
||||
db.write('settings', dict(zip(form.getlist('setting'), form.getlist('value'))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue