From 0866c872f83c4e0a5d80bae5111042c2408d6598 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Mon, 2 Mar 2015 00:16:26 +0100 Subject: reproducible: scheduler: consider different suites as separated while scheduling packages --- bin/reproducible_scheduler.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_scheduler.py b/bin/reproducible_scheduler.py index 39d9f0a7..d32f8685 100755 --- a/bin/reproducible_scheduler.py +++ b/bin/reproducible_scheduler.py @@ -200,14 +200,19 @@ def scheduler_old_versions(suite, limit): def scheduler(suite): - total = int(query_db('SELECT count(*) FROM schedule')[0][0]) + query = 'SELECT count(*) ' + \ + 'FROM schedule AS p JOIN sources AS s ON p.package_id=s.id ' + \ + 'WHERE s.suite="{suite}"'.format(suite=suite) + total = int(query_db(query)[0][0]) log.debug('current scheduled packages: ' + str(total)) if total > 250: build_page('scheduled') # from reproducible_html_indexes - log.info(str(total) + ' packages already scheduled, nothing to do.') + log.info(str(total) + ' packages already scheduled in ' + suite + + ', nothing to do here.') return else: - log.info(str(total) + ' packages already scheduled, scheduling some more...') + log.info(str(total) + ' packages already scheduled in ' + suite + + ', scheduling some more...') # unknown packages log.info('Requesting 200 unknown packages...') unknown = scheduler_unknown_packages(suite, 200) @@ -263,7 +268,16 @@ def scheduler(suite): if __name__ == '__main__': + overall = int(query_db('SELECT count(*) FROM schedule')[0][0]) + if overall > 800: + build_page('scheduled') # from reproducible_html_indexes + log.info(str(overall) + ' packages already scheduled, nothing to do.') + sys.exit() + else: + log.info(str(overall) + ' packages already scheduled, scheduling some more...') for suite in SUITES: call_apt_update(suite) update_sources_tables(suite) scheduler(suite) + overall = int(query_db('SELECT count(*) FROM schedule')[0][0]) + log.info(str(overall) + ' packages scheduled at the end, in all suites.') -- cgit v1.2.3-70-g09d2