summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-05-12 15:53:39 +0200
committerHolger Levsen <holger@layer-acht.org>2015-05-12 15:54:17 +0200
commitd9265663a79b856f21b673a9c640d7d7b6e93d76 (patch)
tree1d8726f5144b21a76724ad719e132cc1e8a8151c
parenta40b935fcb6fac345d29ca4bc61b5ddfa2980937 (diff)
downloadjenkins.debian.net-d9265663a79b856f21b673a9c640d7d7b6e93d76.tar.xz
reproducible: remote_scheduler: fix time comparison for maximum schedulings per day + fix typos
-rwxr-xr-xbin/reproducible_remote_scheduler.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/reproducible_remote_scheduler.py b/bin/reproducible_remote_scheduler.py
index a124806e..ebab903a 100755
--- a/bin/reproducible_remote_scheduler.py
+++ b/bin/reproducible_remote_scheduler.py
@@ -114,13 +114,13 @@ log.debug('date_scheduled = ' + date + ' time_delta = ' + str(time_delta))
query = '''SELECT count(*) FROM manual_scheduler
WHERE requester = "{}" AND date_request > "{}"'''
try:
- amount = int(query_db(query.format(requester, date))[0][0])
+ amount = int(query_db(query.format(requester, int(time.time()-86400)))[0][0])
except IndexError:
amount = 0
log.debug(requester + ' already scheduled ' + str(amount) + ' packages today')
if amount + len(ids) > 50:
- log.error(bcolors.FAIL + 'You have exceeded the maximun number of manual ' +
- 'rescheduling allowed for a day. Please ask in ' +
+ log.error(bcolors.FAIL + 'You have exceeded the maximum number of manual ' +
+ 'reschedulings allowed for a day. Please ask in ' +
'#debian-reproducible if you need to schedule more packages.' +
bcolors.ENDC)
sys.exit(1)