Make worker print exceptions rather than explode

This commit is contained in:
Andrew Godwin 2015-09-02 00:09:14 -07:00
parent 15b54b4887
commit 39a82e2a5c

View File

@ -1,4 +1,4 @@
import time
import traceback
class Worker(object):
@ -22,4 +22,7 @@ class Worker(object):
consumer = self.channel_backend.registry.consumer_for_channel(channel)
if self.callback:
self.callback(channel, message)
consumer(channel=channel, **message)
try:
consumer(channel=channel, **message)
except:
traceback.print_exc()