diff --git a/db.py b/db.py index 000f577..cf428e5 100644 --- a/db.py +++ b/db.py @@ -295,7 +295,10 @@ class ProjectDB: self.conn.execute("COMMIT") return df_id except Exception: - self.conn.execute("ROLLBACK") + try: + self.conn.execute("ROLLBACK") + except Exception: + pass raise # ------------------------------------------------------------------ diff --git a/utils.py b/utils.py index 805ec79..af80c60 100644 --- a/utils.py +++ b/utils.py @@ -225,7 +225,10 @@ def sync_to_db(db, project_name: str, file_path: Path, data: dict) -> None: db.conn.execute("COMMIT") except Exception: - db.conn.execute("ROLLBACK") + try: + db.conn.execute("ROLLBACK") + except Exception: + pass raise except Exception as e: logger.warning(f"sync_to_db failed: {e}")