Skip to content

Commit

Permalink
full_updates optional for commit fillers
Browse files Browse the repository at this point in the history
  • Loading branch information
wschuell committed Nov 19, 2024
1 parent 71af783 commit 12ca41b
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions repodepo/fillers/commit_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ def __init__(
temp_repodir=False,
refresh_list=True,
solve_orig_repo=True,
full_updates_notif=True,
**kwargs
):
self.full_updates_notif = full_updates_notif
self.force = force
self.solve_orig_repo = solve_orig_repo
self.refresh_list = refresh_list
Expand Down Expand Up @@ -337,9 +339,10 @@ def fill_commit_info(self, force=False, all_commits=False, repo_list=None):
self.logger.error("Error with {}".format(repo_info))
raise

self.db.cursor.execute(
"""INSERT INTO full_updates(update_type,updated_at) VALUES('commits',(SELECT CURRENT_TIMESTAMP));"""
)
if self.full_updates_notif:
self.db.cursor.execute(
"""INSERT INTO full_updates(update_type,updated_at) VALUES('commits',(SELECT CURRENT_TIMESTAMP));"""
)
self.db.connection.commit()
else:
self.logger.info("Skipping filling of commits info")
Expand Down Expand Up @@ -451,9 +454,10 @@ def fill_commit_info_sequential(self, force=False, all_commits=False):
except:
self.logger.error("Clone folder absent: {}".format(repo_folder))

self.db.cursor.execute(
"""INSERT INTO full_updates(update_type,updated_at) VALUES('commits',(SELECT CURRENT_TIMESTAMP));"""
)
if self.full_updates_notif:
self.db.cursor.execute(
"""INSERT INTO full_updates(update_type,updated_at) VALUES('commits',(SELECT CURRENT_TIMESTAMP));"""
)
self.db.connection.commit()
else:
self.logger.info("Skipping filling of commits info")
Expand Down Expand Up @@ -1486,10 +1490,10 @@ def fill_commit_orig_repo(self, only_null=True, force=False, autocommit=True):
;
"""
)

self.db.cursor.execute(
"""INSERT INTO full_updates(update_type) VALUES('commits orig repos');"""
)
if self.full_updates_notif:
self.db.cursor.execute(
"""INSERT INTO full_updates(update_type) VALUES('commits orig repos');"""
)

if autocommit:
self.db.connection.commit()
Expand Down Expand Up @@ -1802,9 +1806,10 @@ def fill_commit_created_at(self, force=False, autocommit=True, batch_size=1000):
)
)

self.db.cursor.execute(
"""INSERT INTO full_updates(update_type) VALUES('commits created_at');"""
)
if self.full_updates_notif:
self.db.cursor.execute(
"""INSERT INTO full_updates(update_type) VALUES('commits created_at');"""
)

self.logger.info("Fixed commits created_at")
if autocommit:
Expand Down

0 comments on commit 12ca41b

Please sign in to comment.