Skip to content
Snippets Groups Projects

Draft: adjust transaction handling (and another context related changes)

Open Pierre-Yves David requested to merge marmoute/swh-core:txn into master
1 file
+ 2
7
Compare changes
  • Side-by-side
  • Inline
+ 2
7
@@ -198,14 +198,9 @@ class BaseDb:
a psycopg cursor
"""
with self.conn.cursor() as cur:
try:
with self.conn.transaction():
with self.conn.cursor() as cur:
yield cur
self.conn.commit()
except Exception:
if not self.conn.closed:
self.conn.rollback()
raise
def copy_to(
self,
Loading