1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Wrapped DB write operations in transactions to ensure integrity

This commit is contained in:
krateng 2022-04-25 21:50:40 +02:00
parent 9c6c91f594
commit 8845f931df

View File

@ -115,8 +115,9 @@ def connection_provider(func):
return func(*args,**kwargs)
else:
with engine.connect() as connection:
kwargs['dbconn'] = connection
return func(*args,**kwargs)
with connection.begin():
kwargs['dbconn'] = connection
return func(*args,**kwargs)
wrapper.__innerfunc__ = func
return wrapper