From d9265663a79b856f21b673a9c640d7d7b6e93d76 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Tue, 12 May 2015 15:53:39 +0200 Subject: reproducible: remote_scheduler: fix time comparison for maximum schedulings per day + fix typos --- bin/reproducible_remote_scheduler.py | 6 +++--- 1 file 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) -- cgit v1.2.3-70-g09d2