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:
parent
9c6c91f594
commit
8845f931df
@ -115,8 +115,9 @@ def connection_provider(func):
|
|||||||
return func(*args,**kwargs)
|
return func(*args,**kwargs)
|
||||||
else:
|
else:
|
||||||
with engine.connect() as connection:
|
with engine.connect() as connection:
|
||||||
kwargs['dbconn'] = connection
|
with connection.begin():
|
||||||
return func(*args,**kwargs)
|
kwargs['dbconn'] = connection
|
||||||
|
return func(*args,**kwargs)
|
||||||
|
|
||||||
wrapper.__innerfunc__ = func
|
wrapper.__innerfunc__ = func
|
||||||
return wrapper
|
return wrapper
|
||||||
|
Loading…
Reference in New Issue
Block a user