Browse Source

并行更新两个脚本

xueyiming 2 weeks ago
parent
commit
a63d4e46ba
1 changed files with 29 additions and 4 deletions
  1. 29 4
      ad/02_ad_model_dnn_v11_update.sh

+ 29 - 4
ad/02_ad_model_dnn_v11_update.sh

@@ -220,10 +220,35 @@ bucket_feature_from_origin_to_hive() {
 run_pai_flow() {
   local step_start_time=$(date +%s)
 
-  python ad/pai_flow_operator.py
-  
-  local return_code=$?
-  check_run_status ${return_code} ${step_start_time} "PAI工作流任务" "PAI工作流执行失败"
+  # 并行启动两个 Python 脚本
+  python ad/pai_flow_operator.py &
+  pid1=$!
+
+  python ad/pai_flow_operator_v2.py &
+  pid2=$!
+
+  # 等待两个进程完成并获取返回码
+  wait $pid1
+  return_code1=$?
+
+  wait $pid2
+  return_code2=$?
+
+  # 检查两个脚本的执行状态
+  if [ $return_code1 -ne 0 ]; then
+    check_run_status $return_code1 $step_start_time "PAI工作流任务1" "PAI工作流任务1执行失败"
+    return $return_code1
+  fi
+
+  if [ $return_code2 -ne 0 ]; then
+    check_run_status $return_code2 $step_start_time "PAI工作流任务2" "PAI工作流任务2执行失败"
+    return $return_code2
+  fi
+
+  # 两个任务都成功执行
+  local duration=$(( $(date +%s) - step_start_time ))
+  log_info "PAI工作流任务1和任务2 执行成功,耗时 ${duration}秒"
+  return 0
 }
 
 calc_model_predict() {