Skip to content

Commit

Permalink
Small changes to workers
Browse files Browse the repository at this point in the history
Decrease game runtime limit since #342 fixed.
Add logging for #341.
  • Loading branch information
j-mao committed Jan 20, 2020
1 parent 24b0a16 commit 9881222
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions infrastructure/worker/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
SUB_ACK_DEADLINE = 30 # Value to which ack deadline is reset
SUB_SLEEP_TIME = 10 # Interval between checks for new jobs and ack deadline

TIMEOUT_UNZIP = 30 # Maximum execution time for unzipping submission archive
TIMEOUT_PULL = 150 # Maximum execution time for updating distribution
TIMEOUT_COMPILE = 300 # Maximum execution time for submission compilation
TIMEOUT_GAME = 36000 # Maximum execution time for game running
TIMEOUT_UNZIP = 30 # Maximum execution time for unzipping submission archive
TIMEOUT_PULL = 150 # Maximum execution time for updating distribution
TIMEOUT_COMPILE = 300 # Maximum execution time for submission compilation
TIMEOUT_GAME = 3600 # Maximum execution time for game running

GAME_WINNER = '^\[server\]\s*.*\([AB]\) wins \(round [0-9]+\)$'

Expand Down
4 changes: 2 additions & 2 deletions infrastructure/worker/app/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def renew_deadline():
client.modify_ack_deadline(subscription_path, [message.ack_id], ack_deadline_seconds=SUB_ACK_DEADLINE)
logging.debug('Reset ack deadline for {} for {}s'.format(message.message.data.decode(), SUB_ACK_DEADLINE))
time.sleep(SUB_SLEEP_TIME)
except:
logging.warning('Could not reset ack deadline')
except Exception as e:
logging.warning('Could not reset ack deadline', exc_info=e)
watcher = threading.Thread(target=renew_deadline)
watcher.start()

Expand Down

0 comments on commit 9881222

Please sign in to comment.