Skip to content

Commit db45a1d

Browse files
committed
ariadne: Don't schedule builds if sync operation is in progress
1 parent d964992 commit db45a1d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/lkarchive/ariadne.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
session_scope,
2121
config_get_value,
2222
)
23+
from laniakea.utils import process_file_lock
2324
from laniakea.ariadne import schedule_package_builds_for_source
2425

2526

@@ -228,10 +229,14 @@ def update_jobs(
228229
continue
229230
processed = True
230231

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

236241
if not processed:
237242
if suite_name and repo_name:

0 commit comments

Comments
 (0)