整理线上配置

main
RogerWork 9 months ago
parent 36b9d9a369
commit db074070ea
  1. 6
      update/consumers.py

@ -13,7 +13,6 @@ class UpdateConsumer(WebsocketConsumer):
redis_conn = get_redis_connection()
if text_data is None:
self.send('你发了啥')
else:
@ -27,12 +26,15 @@ class UpdateConsumer(WebsocketConsumer):
redis_key = f'cinema_update_status_{ip}'
if redis_conn.exists(redis_key):
redis_conn.delete(redis_key)
print(cinema_update_status.get(ip, None))
data = json.loads(redis_conn.get(redis_key))
print('ws任务完成消息', data)
if data.get('ip', False):
ip = data['ip']
redis_key = f'cinema_update_status_{ip}'
# print('ws发送消息前', cinema_update_status)
data = json.loads(redis_conn.get(redis_key))
print('ws发送消息前', data)
self.send(json.dumps({'status': {'ip': ip, 'result': data}}))
else:
self.send(text_data)

Loading…
Cancel
Save