Skip to content

Commit

Permalink
ariadne: Don't schedule builds if sync operation is in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ximion committed May 10, 2024
1 parent d964992 commit db45a1d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/lkarchive/ariadne.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
session_scope,
config_get_value,
)
from laniakea.utils import process_file_lock
from laniakea.ariadne import schedule_package_builds_for_source


Expand Down Expand Up @@ -228,10 +229,14 @@ def update_jobs(
continue
processed = True

log.info('Processing {}:{}'.format(rss.repo.name, rss.suite.name))
scheduled_count += update_package_build_schedule(session, rss, simulate, limit_arch, limit_count)
if limit_count > 0 and scheduled_count >= limit_count:
break
# during long sync operation, we might have a lot of source packages in the archive before
# the binaries are synced, so to avoid scheduling unnecessary builds we need to wait for any
# pending sync operation to complete first
with process_file_lock('sync_{}'.format(rss.repo.name)):
log.info('Processing {}:{}'.format(rss.repo.name, rss.suite.name))
scheduled_count += update_package_build_schedule(session, rss, simulate, limit_arch, limit_count)
if limit_count > 0 and scheduled_count >= limit_count:
break

if not processed:
if suite_name and repo_name:
Expand Down

0 comments on commit db45a1d

Please sign in to comment.