From 289737ed00e1bcd39612e5807b44c20da6829962 Mon Sep 17 00:00:00 2001 From: isummer Date: Sat, 12 Nov 2022 21:11:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=82=E5=B8=B8=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_ser/xsign/utils/modelutils.py | 6 +++--- fir_ser/xsign/utils/supersignutils.py | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fir_ser/xsign/utils/modelutils.py b/fir_ser/xsign/utils/modelutils.py index fb4a740..50b0743 100644 --- a/fir_ser/xsign/utils/modelutils.py +++ b/fir_ser/xsign/utils/modelutils.py @@ -70,9 +70,9 @@ def check_super_sign_permission(user_obj): return True -def check_ipa_is_latest_sign(app_obj, developer_obj=None): - if AppUDID.objects.filter(app_id=app_obj, udid__developerid=developer_obj, - sign_status__lt=SignStatus.SIGNATURE_PACKAGE_COMPLETE).first(): +def check_ipa_is_latest_sign(app_obj, developer_obj=None, app_udid_obj=None): + if not app_udid_obj and AppUDID.objects.filter(app_id=app_obj, udid__developerid=developer_obj, + sign_status__lt=SignStatus.SIGNATURE_PACKAGE_COMPLETE).first(): return release_obj = AppReleaseInfo.objects.filter(app_id=app_obj, is_master=True).first() all_app_to_dev = APPToDeveloper.objects.filter(app_id=app_obj) diff --git a/fir_ser/xsign/utils/supersignutils.py b/fir_ser/xsign/utils/supersignutils.py index 9299dec..38181fd 100644 --- a/fir_ser/xsign/utils/supersignutils.py +++ b/fir_ser/xsign/utils/supersignutils.py @@ -472,7 +472,7 @@ def check_sign_is_exists(user_obj, app_obj, udid, developer_obj, sign=True): app_udid_obj = AppUDID.objects.filter(app_id=app_obj, udid__udid=udid, udid__developerid=developer_obj).first() if app_udid_obj and app_udid_obj.sign_status >= SignStatus.PROFILE_DOWNLOAD_COMPLETE: if app_udid_obj.sign_status == SignStatus.SIGNATURE_PACKAGE_COMPLETE: - if check_ipa_is_latest_sign(app_obj, developer_obj): + if check_ipa_is_latest_sign(app_obj, developer_obj, app_udid_obj): d_result['msg'] = f'udid {udid} exists app_id {app_obj}' logger.warning(d_result) return True, d_result @@ -624,6 +624,13 @@ class IosUtils(object): udid=udid_obj, sign_status=SignStatus.PROFILE_DOWNLOAD_COMPLETE).update( sign_status=SignStatus.SIGNATURE_PACKAGE_COMPLETE) + base_app_udid = AppUDID.objects.filter(app_id=app_obj, udid__developerid_id=developer_obj_id) + if base_app_udid.filter(sign_status__lt=SignStatus.SIGNATURE_PACKAGE_COMPLETE).count(): + c_time = base_app_udid.order_by('-created_time').first() + u_time = base_app_udid.order_by('-updated_time').first() + if u_time.updated_time > c_time.created_time: + base_app_udid.update(sign_status=SignStatus.SIGNATURE_PACKAGE_COMPLETE) + del_cache_response_by_short(app_obj.app_id) MagicCacheData.invalid_cache(app_obj.app_id) return True