def send_in_channel(channel, topic, payload): message = { 'type': 'message.send', 'text': json.dumps({ 'topic': topic, 'payload': payload, }), } try: channel_layer_send_sync(channel, message) except ChannelFull: # maybe this means the subscription is invalid now? sentry_client.captureException() else: stats.pushed_via_websocket(topic)
def send_in_channel(channel, topic, payload): message = { 'type': 'message.send', 'text': json.dumps({ 'topic': topic, 'payload': payload, }), } try: channel_layer_send_sync(channel, message) except ChannelFull: # TODO investigate this more # maybe this means the subscription is invalid now? sentry_client.captureException() except RuntimeError: # TODO investigate this more (but let the code continue in the meantime...) sentry_client.captureException() else: stats.pushed_via_websocket(topic)