diff --git a/fir_ser/api/utils/app/supersignutils.py b/fir_ser/api/utils/app/supersignutils.py index 711406f..9b268b9 100644 --- a/fir_ser/api/utils/app/supersignutils.py +++ b/fir_ser/api/utils/app/supersignutils.py @@ -41,7 +41,7 @@ def check_org_file(user_obj, org_file): os.makedirs(os.path.dirname(org_file)) if os.path.isfile(org_file): - return + return True storage_obj = Storage(user_obj) return download_files_form_oss(storage_obj, org_file) @@ -474,7 +474,10 @@ class IosUtils(object): def exec_sign(user_obj, app_obj, developer_obj, random_file_name, release_obj): resign_app_obj = IosUtils.get_resign_obj(user_obj, developer_obj) org_file = os.path.join(MEDIA_ROOT, release_obj.release_id + ".ipa") - check_org_file(user_obj, org_file) + if not check_org_file(user_obj, org_file): + msg = f"{user_obj} {developer_obj} {app_obj} sign_ipa failed ERROR:'签名包检测失败,或许文件下载失败'" + logger.error(msg) + return False, msg new_file = os.path.join(MEDIA_ROOT, random_file_name + ".ipa") properties_info = {} if app_obj.new_bundle_id: diff --git a/fir_ser/api/utils/utils.py b/fir_ser/api/utils/utils.py index b8e0f9e..796fc45 100644 --- a/fir_ser/api/utils/utils.py +++ b/fir_ser/api/utils/utils.py @@ -204,10 +204,10 @@ def change_storage_and_change_advert_img(user_obj, new_storage_obj, clean_old_da migrating_storage_file_data(user_obj, user_advert_obj.ad_pic, new_storage_obj, clean_old_data) -def download_files_form_oss(storage_obj, org_file): +def download_files_form_oss(storage_obj, org_file, force=False): with cache.lock("%s_%s" % ('download_files_form_oss', org_file), timeout=60 * 30): - if os.path.isfile(org_file): - return + if os.path.isfile(org_file) and not force: + return True if storage_obj.download_file(os.path.basename(org_file), org_file + ".check.tmp"): if os.path.isfile(org_file) and os.path.exists(org_file + ".check.tmp"): os.remove(org_file) @@ -252,12 +252,12 @@ def migrating_storage_file_data(user_obj, filename, new_storage_obj, clean_old_d else: if new_storage_obj.get_storage_type() == 3: # 云存储下载 本地,并删除云存储 - if download_files_form_oss(old_storage_obj, local_file_full_path): + if download_files_form_oss(old_storage_obj, local_file_full_path, True): if clean_old_data: old_storage_obj.delete_file(filename) else: # 云存储互传,先下载本地,然后上传新云存储,删除本地和老云存储 - if download_files_form_oss(old_storage_obj, local_file_full_path): + if download_files_form_oss(old_storage_obj, local_file_full_path, True): new_storage_obj.upload_file(local_file_full_path) delete_local_files(filename) if clean_old_data: