|
|
@ -5,7 +5,7 @@ from django.http import JsonResponse |
|
|
|
from django.db.models import Q |
|
|
|
from django.db.models import Q |
|
|
|
from rest_framework import viewsets, permissions, status, filters |
|
|
|
from rest_framework import viewsets, permissions, status, filters |
|
|
|
from rest_framework.filters import OrderingFilter |
|
|
|
from rest_framework.filters import OrderingFilter |
|
|
|
|
|
|
|
from django_redis import get_redis_connection |
|
|
|
from update.models import Cinema |
|
|
|
from update.models import Cinema |
|
|
|
from update.serializers import * |
|
|
|
from update.serializers import * |
|
|
|
from rest_framework.views import APIView |
|
|
|
from rest_framework.views import APIView |
|
|
@ -125,6 +125,8 @@ def update_cine(request): |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
cinema_update_status[cinema_ip] = copy.deepcopy(update_status) |
|
|
|
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) |
|
|
|
print("ws调试", cinema_update_status) |
|
|
|
|
|
|
|
|
|
|
|
short_release = req.get('version') |
|
|
|
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']['result'] = 'fail' |
|
|
|
cinema_update_status[cinema_ip]['config']['msg'] = config_before_output + '<br/>' + str(e) |
|
|
|
cinema_update_status[cinema_ip]['config']['msg'] = config_before_output + '<br/>' + str(e) |
|
|
|
return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': 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'])) |
|
|
|
client_list = list(set(cmd_list) & set(cmd_dict['client'])) |
|
|
|
if len(client_list) > 0: |
|
|
|
if len(client_list) > 0: |
|
|
|