Skip to content

Commit

Permalink
added auto commit of commit error in table_updates when clone fails a…
Browse files Browse the repository at this point in the history
…s a part of sequential commit filler
  • Loading branch information
wschuell committed Nov 30, 2024
1 parent a8e2afb commit 89f1851
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion repodepo/fillers/commit_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,35 @@ def clone_repo(self, source, name, owner, clone_folder=None):
clone_folder=clone_folder,
)
clone_filler.prepare()
clone_filler.apply()
try:
clone_filler.apply()
except:
if self.db.db_type == "postgres":
self.db.cursor.execute(
"""INSERT INTO table_updates(repo_id,table_name,success)
SELECT r.id,'commits',false
FROM sources s
INNER JOIN repositories r
ON s.name=%(source)s AND s.id=r.source
AND r.owner=%(owner)s
AND r.name=%(name)s
;""",
dict(source=source, name=name, owner=owner),
)
else:
self.db.cursor.execute(
"""INSERT INTO table_updates(repo_id,table_name,success)
SELECT r.id,'commits',0
FROM sources s
INNER JOIN repositories r
ON s.name=:source AND s.id=r.source
AND r.owner=:owner
AND r.name=:name
;""",
dict(source=source, name=name, owner=owner),
)
self.db.connection.commit()
raise

def list_commits(
self,
Expand Down

0 comments on commit 89f1851

Please sign in to comment.