Skip to content

Commit

Permalink
Catch invalid notification message
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed Feb 1, 2016
1 parent a2432ec commit 03c1fe9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/import_submissions.py
Expand Up @@ -35,7 +35,11 @@ def main_master(script, opts, args):
channel = script.redis.pubsub()
channel.subscribe('channel.submissions')
for message in channel.listen():
ids = json.loads(message['data'])
try:
ids = json.loads(message['data'])
except Exception:
logger.exception('Invalid notification message: %r', message)
ids = []
logger.debug('Got notified about %s new submissions', len(ids))
do_import(script)
logger.debug('Waiting for the next event...')
Expand Down

0 comments on commit 03c1fe9

Please sign in to comment.