Explorar el Código

feat:修改定时任务脚本

zhaohaipeng hace 10 meses
padre
commit
74e9b6f562
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  1. 12 0
      ad/01_ad_model_update_everyday.sh

+ 12 - 0
ad/01_ad_model_update_everyday.sh

@@ -99,7 +99,19 @@ $HADOOP fs -text ${bucketFeatureSavePath}/${today}/* | ${FM_HOME}/bin/fm_predict
 
 # shellcheck disable=SC2006
 online_auc=`cat ${PREDICT_PATH}/${model_name}_${today}_online.txt | /root/sunmingze/AUC/AUC`
+if [ $? -ne 0 ]; then
+   echo "线上模型AUC计算失败"
+   /root/anaconda3/bin/python ad/ad_monitor_util.py "线上模型AUC计算失败"
+   exit 1
+fi
+
 new_auc=`cat ${PREDICT_PATH}/${model_name}_${today}_new.txt | /root/sunmingze/AUC/AUC`
+if [ $? -ne 0 ]; then
+   echo "新模型AUC计算失败"
+   /root/anaconda3/bin/python ad/ad_monitor_util.py "新模型AUC计算失败"
+   exit 1
+fi
+
 if [ "$online_auc" \< "$new_auc" ]; then
     echo "新模型优于线上模型: 线上模型AUC: ${online_auc}, 新模型AUC: ${new_auc}"
     /root/anaconda3/bin/python ad/ad_monitor_util.py "新模型优于线上模型: 线上模型AUC: ${online_auc}, 新模型AUC: ${new_auc}"