From 3411007afbb28aa54f217adf967dbfb946f1ca30 Mon Sep 17 00:00:00 2001 From: RogerWork Date: Mon, 18 Mar 2024 12:00:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update/views.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/update/views.py b/update/views.py index 3d2ad00..8bc268b 100644 --- a/update/views.py +++ b/update/views.py @@ -183,7 +183,7 @@ def update_cine(request): update_status['git']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -209,7 +209,7 @@ def update_cine(request): update_status['setup']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -233,7 +233,7 @@ def update_cine(request): update_status['sql']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -256,7 +256,7 @@ def update_cine(request): update_status['config']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -282,7 +282,7 @@ def update_cine(request): update_status['teardown']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -305,7 +305,7 @@ def update_cine(request): update_status['config']['msg'] = config_before_output + '
' + str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -330,7 +330,7 @@ def update_cine(request): update_status['client']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)})