diff --git a/update/views.py b/update/views.py index c872bf9..912eb97 100644 --- a/update/views.py +++ b/update/views.py @@ -5,7 +5,7 @@ from django.http import JsonResponse from django.db.models import Q from rest_framework import viewsets, permissions, status, filters from rest_framework.filters import OrderingFilter - +from django_redis import get_redis_connection from update.models import Cinema from update.serializers import * from rest_framework.views import APIView @@ -125,6 +125,8 @@ def update_cine(request): } cinema_update_status[cinema_ip] = copy.deepcopy(update_status) + redis_conn = get_redis_connection() + redis_conn.set(f'cinema_update_status_{cinema_ip}', json.dumps(update_status), 10*60) print("ws调试", cinema_update_status) short_release = req.get('version') @@ -229,7 +231,8 @@ def update_cine(request): cinema_update_status[cinema_ip]['config']['result'] = 'fail' cinema_update_status[cinema_ip]['config']['msg'] = config_before_output + '
' + str(e) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) - + d = redis_conn.get(f'cinema_update_status_{cinema_ip}') + print(d) # 传输客户端 client_list = list(set(cmd_list) & set(cmd_dict['client'])) if len(client_list) > 0: