summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-03-02 00:16:26 +0100
committerHolger Levsen <holger@layer-acht.org>2015-03-02 00:28:10 +0100
commit0866c872f83c4e0a5d80bae5111042c2408d6598 (patch)
treefa0b45076ce810b50ace2b6ba0594d81fb6258a0
parent6fc83f61067b13642b14f2a10be340883bfba24e (diff)
downloadjenkins.debian.net-0866c872f83c4e0a5d80bae5111042c2408d6598.tar.xz
reproducible: scheduler: consider different suites as separated while scheduling packages
-rwxr-xr-xbin/reproducible_scheduler.py20
1 files changed, 17 insertions, 3 deletions
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.')