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