diff --git a/fir_client/src/components/FirAppInfosBase.vue b/fir_client/src/components/FirAppInfosBase.vue index 89bea3a..839b96e 100644 --- a/fir_client/src/components/FirAppInfosBase.vue +++ b/fir_client/src/components/FirAppInfosBase.vue @@ -60,7 +60,7 @@ + v-if="appinfos.type===1 || appinfos.issupersign "> 超级签名 diff --git a/fir_ser/api/utils/app/supersignutils.py b/fir_ser/api/utils/app/supersignutils.py index 4578f16..914e6c4 100644 --- a/fir_ser/api/utils/app/supersignutils.py +++ b/fir_ser/api/utils/app/supersignutils.py @@ -4,7 +4,7 @@ # author: liuyu # date: 2020/3/6 -import uuid, xmltodict, os, re, logging, time, requests +import uuid, xmltodict, os, re, logging, time from fir_ser.settings import SUPER_SIGN_ROOT, MEDIA_ROOT, SERVER_DOMAIN, MOBILECONFIG_SIGN_SSL from api.utils.app.iossignapi import AppDeveloperApi, ResignApp, AppDeveloperApiV2 from api.models import APPSuperSignUsedInfo, AppUDID, AppIOSDeveloperInfo, AppReleaseInfo, Apps, APPToDeveloper, \ @@ -15,6 +15,7 @@ from api.utils.storage.caches import del_cache_response_by_short, send_msg_over_ from api.utils.utils import file_format_path, delete_app_to_dev_and_file, delete_app_profile_file, \ send_ios_developer_active_status, get_profile_full_path, delete_local_files, download_files_form_oss from api.utils.storage.storage import Storage +from django.core.cache import cache logger = logging.getLogger(__file__) @@ -488,8 +489,9 @@ class IosUtils(object): logger.info( "call_loop download_profile appid:%s developer:%s count:%s" % (self.app_obj, self.developer_obj, count)) if self.developer_obj: - download_flag, result = IosUtils.exec_download_profile(self.app_obj, self.developer_obj, - self.udid_info, sign_try_attempts) + with cache.lock("%s_%s_%s" % ('download_profile', self.app_obj, self.developer_obj)): + download_flag, result = IosUtils.exec_download_profile(self.app_obj, self.developer_obj, + self.udid_info, sign_try_attempts) if download_flag: call_flag = False else: @@ -521,8 +523,10 @@ class IosUtils(object): developerid=self.developer_obj, app_id=self.app_obj) - return IosUtils.run_sign(self.user_obj, self.app_obj, self.developer_obj, download_flag, self, start_time, - result) + with cache.lock("%s_%s_%s" % ('run_sign', self.app_obj, self.developer_obj)): + logger.info("start run_sign ...") + return IosUtils.run_sign(self.user_obj, self.app_obj, self.developer_obj, download_flag, self, start_time, + result) @staticmethod def disable_udid(udid_obj, app_id): diff --git a/fir_ser/api/utils/storage/caches.py b/fir_ser/api/utils/storage/caches.py index c24a050..cbb7c66 100644 --- a/fir_ser/api/utils/storage/caches.py +++ b/fir_ser/api/utils/storage/caches.py @@ -189,6 +189,9 @@ def del_cache_storage(user_obj): for storage_key in cache.iter_keys(storage_keys): cache.delete(storage_key) + download_val = CACHE_KEY_TEMPLATE.get('download_url_key') + cache.delete("_".join(['', download_val, os.path.basename(user_obj.head_img)])) + def set_app_today_download_times(app_id): now = timezone.now() diff --git a/fir_ser/api/utils/storage/storage.py b/fir_ser/api/utils/storage/storage.py index 164b8db..6a91635 100644 --- a/fir_ser/api/utils/storage/storage.py +++ b/fir_ser/api/utils/storage/storage.py @@ -118,6 +118,7 @@ class Storage(object): base64.b64encode(json.dumps(auth).encode("utf-8")).decode("utf-8")[0:64]]) new_storage_obj = cache.get(storage_key) if new_storage_obj: + logger.info("user %s get default storage obj cache %s" % (user, new_storage_obj)) return new_storage_obj else: if storage_type == 1: diff --git a/fir_ser/api/utils/utils.py b/fir_ser/api/utils/utils.py index ac7d87b..9cc7678 100644 --- a/fir_ser/api/utils/utils.py +++ b/fir_ser/api/utils/utils.py @@ -305,17 +305,18 @@ def migrating_storage_file_data(user_obj, filename, new_storage_obj, clean_old_d def migrating_storage_data(user_obj, new_storage_obj, clean_old_data): for app_release_obj in AppReleaseInfo.objects.filter(app_id__user_id=user_obj).all(): - #迁移APP数据 + # 迁移APP数据 filename = get_filename_from_apptype(app_release_obj.release_id, app_release_obj.release_type) migrating_storage_file_data(user_obj, filename, new_storage_obj, clean_old_data) migrating_storage_file_data(user_obj, app_release_obj.icon_url, new_storage_obj, clean_old_data) - #迁移超级签数据 + # 迁移超级签数据 for apptodev_obj in APPToDeveloper.objects.filter(app_id=app_release_obj.app_id).all(): filename = get_filename_from_apptype(apptodev_obj.binary_file, app_release_obj.release_type) migrating_storage_file_data(user_obj, filename, new_storage_obj, clean_old_data) return True + def clean_storage_data(user_obj, storage_obj=None): storage_obj = Storage(user_obj, storage_obj) for app_release_obj in AppReleaseInfo.objects.filter(app_id__user_id=user_obj).all(): diff --git a/fir_ser/files/embedded.mobileprovision b/fir_ser/files/embedded.mobileprovision index ff25502..e729446 100644 Binary files a/fir_ser/files/embedded.mobileprovision and b/fir_ser/files/embedded.mobileprovision differ