Selaa lähdekoodia

Merge branch 'test' of https://git.yishihui.com/algorithm/rov-offline into test

caida 2 vuotta sitten
vanhempi
commit
eeba1ae434
2 muutettua tiedostoa jossa 7 lisäystä ja 3 poistoa
  1. 2 2
      region_rule_rank_h_task.sh
  2. 5 1
      rule_rank_h_by_24h.py

+ 2 - 2
region_rule_rank_h_task.sh

@@ -4,10 +4,10 @@ if [[ $ROV_OFFLINE_ENV == 'test' ]]; then
     cd /data2/rov-offline && /root/anaconda3/bin/python /data2/rov-offline/rule_rank_h_by_24h.py &&
      /root/anaconda3/bin/python /data2/rov-offline/region_rule_rank_h_by24h.py &&
       /root/anaconda3/bin/python /data2/rov-offline/region_rule_rank_h.py '24h'
-      /root/anaconda3/bin/python /data2/rov-offline/laohaokan_recommend_update.py
+#      /root/anaconda3/bin/python /data2/rov-offline/laohaokan_recommend_update.py
 elif [[ $ROV_OFFLINE_ENV == 'pro' ]]; then
     cd /data/rov-offline && /root/anaconda3/bin/python /data/rov-offline/rule_rank_h_by_24h.py &&
      /root/anaconda3/bin/python /data/rov-offline/region_rule_rank_h_by24h.py &&
       /root/anaconda3/bin/python /data/rov-offline/region_rule_rank_h.py '24h'
-      /root/anaconda3/bin/python /data/rov-offline/laohaokan_recommend_update.py
+#      /root/anaconda3/bin/python /data/rov-offline/laohaokan_recommend_update.py
 fi

+ 5 - 1
rule_rank_h_by_24h.py

@@ -443,7 +443,11 @@ def h_timer_check():
         now_h = datetime.now().hour
         # 查看当前天级更新的数据是否已准备好
         h_data_count = h_data_check(project=project, table=table, now_date=now_date, now_h=now_h)
-        if h_data_count > 0:
+        if now_h == 23 or now_h < 8:
+            log_.info(f'now_h = {now_h} use bottom data!')
+            h_rank_bottom(now_date=now_date, now_h=now_h, rule_params=rule_params)
+            log_.info(f"24h_data end!")
+        elif h_data_count > 0:
             log_.info(f'h_by24h_data_count = {h_data_count}')
             # 数据准备好,进行更新
             rank_by_h(now_date=now_date, now_h=now_h, rule_params=rule_params, project=project, table=table)