mirror of
https://github.com/django/daphne.git
synced 2025-07-14 09:52:17 +03:00
Make worker print exceptions rather than explode
This commit is contained in:
parent
15b54b4887
commit
39a82e2a5c
|
@ -1,4 +1,4 @@
|
||||||
import time
|
import traceback
|
||||||
|
|
||||||
|
|
||||||
class Worker(object):
|
class Worker(object):
|
||||||
|
@ -22,4 +22,7 @@ class Worker(object):
|
||||||
consumer = self.channel_backend.registry.consumer_for_channel(channel)
|
consumer = self.channel_backend.registry.consumer_for_channel(channel)
|
||||||
if self.callback:
|
if self.callback:
|
||||||
self.callback(channel, message)
|
self.callback(channel, message)
|
||||||
|
try:
|
||||||
consumer(channel=channel, **message)
|
consumer(channel=channel, **message)
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user