1
This commit is contained in:
1 parent
f2b7132007
commit
b65765e670
2 files changed
+6
-6
No files matched your search
@@ -198,15 +198,15 @@ def read_pids_from_json(pid_file):
|
|||||||
# 检查JSON文件是否存在
|
# 检查JSON文件是否存在
|
||||||
if not os.path.exists(json_path):
|
if not os.path.exists(json_path):
|
||||||
print(f"错误: JSON文件不存在 - {json_path}")
|
print(f"错误: JSON文件不存在 - {json_path}")
|
||||||
return []
|
return [], {}
|
||||||
|
|
||||||
# 读取JSON文件
|
# 读取JSON文件
|
||||||
try:
|
try:
|
||||||
with open(json_path, 'r') as f:
|
with open(json_path, 'r', encoding='utf-8') as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"读取JSON文件失败: {e}")
|
print(f"读取JSON文件失败: {e}")
|
||||||
return []
|
return [], {}
|
||||||
|
|
||||||
list_model_info = []
|
list_model_info = []
|
||||||
# 处理每个模型
|
# 处理每个模型
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ def step1(versionId):
|
|||||||
if not ossClient().object_exists(jsonFilePath):
|
if not ossClient().object_exists(jsonFilePath):
|
||||||
return False
|
return False
|
||||||
#下载文件到项目所在目录
|
#下载文件到项目所在目录
|
||||||
dirNow = currentDir + '/batchPrint/' + versionId + '/json'
|
dirNow = os.path.join(currentDir, 'batchPrint', versionId, 'json')
|
||||||
if not os.path.exists(dirNow):
|
if not os.path.exists(dirNow):
|
||||||
os.makedirs(dirNow)
|
os.makedirs(dirNow)
|
||||||
localFilePath = dirNow + '/' + versionId + '.json'
|
localFilePath = os.path.join(dirNow, f'{versionId}.json')
|
||||||
ossClient().get_object_to_file(jsonFilePath, localFilePath)
|
ossClient().get_object_to_file(jsonFilePath, localFilePath)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ def main(work_dir=None):
|
|||||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} JSON文件下载数据失败,等待10秒')
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} JSON文件下载数据失败,等待10秒')
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
continue
|
continue
|
||||||
jsonFilePath = currentDir + '/batchPrint/' + versionId + '/json/' + versionId + '.json'
|
jsonFilePath = os.path.join(currentDir, 'batchPrint', versionId, 'json', f'{versionId}.json')
|
||||||
step2(jsonFilePath, versionId)
|
step2(jsonFilePath, versionId)
|
||||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 数据处理完成,等待10秒')
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 数据处理完成,等待10秒')
|
||||||
requestApiToUpdateSliceStatus(versionId)
|
requestApiToUpdateSliceStatus(versionId)
|
||||||
|
|||||||
Reference in new issue
Block a user