Jelajahi Sumber

VJ验证局部调整

node04 1 bulan lalu
induk
melakukan
52f6b0152d
2 mengubah file dengan 8 tambahan dan 6 penghapusan
  1. 2 0
      descending_cabin_task.py
  2. 6 6
      result_keep_verify.py

+ 2 - 0
descending_cabin_task.py

@@ -4,6 +4,7 @@
 import os
 import json
 import time
+import traceback
 import requests
 import threading
 from datetime import datetime
@@ -660,6 +661,7 @@ def main():
             logger.info(f"上传政策成功")
         except Exception as e:
             logger.error(f"上传政策失败: {e}")
+            logger.error(f"{traceback.format_exc()}")
 
     logger.info(f"keep_info_end: {len(keep_info_end)}")
     # 将 keep_info_end 写入到文件csv 文件 嵌套结构要处理  提供下载页面 (历史数据需要保留)

+ 6 - 6
result_keep_verify.py

@@ -157,11 +157,11 @@ def verify_process(min_batch_time_str, max_batch_time_str):
         valid_end_dt = pd.to_datetime(
             df_keep_info_del.get("valid_end_hour"), format="%Y-%m-%d %H:%M:%S", errors="coerce"
         )
-        status_flag = pd.Series(2, index=df_keep_info_del.index, dtype="int64")
-        status_flag.loc[price_diff_num > 0] = 1
+        status_flag = pd.Series(0, index=df_keep_info_del.index, dtype="int64")   # 默认状态 0
+        status_flag.loc[price_diff_num > 0] = 1   # 降价状态 1
         mask_zero = price_diff_num == 0
         mask_time_ok = mask_zero & del_batch_dt.notna() & valid_end_dt.notna() & (del_batch_dt >= valid_end_dt)
-        status_flag.loc[mask_time_ok] = 0
+        status_flag.loc[mask_time_ok] = 2   # 超时状态 2
         df_keep_info_del["status_flag"] = status_flag
         
         write_header = not os.path.exists(output_path)
@@ -175,7 +175,7 @@ def verify_process(min_batch_time_str, max_batch_time_str):
 
 def verify_process_2(min_batch_time_str, max_batch_time_str):
 
-    object_dir = "/home/node04/descending_cabin_files"
+    object_dir = "/home/node04/descending_cabin_files_vj"
 
     output_dir = f"./validate/keep"
     os.makedirs(output_dir, exist_ok=True)
@@ -376,5 +376,5 @@ def verify_process_2(min_batch_time_str, max_batch_time_str):
     return
 
 if __name__ == "__main__":
-    # verify_process("202604021500", "202604030900")
-    verify_process_2("202604031700", "202604071300")
+    # verify_process("202604071700", "202604090900")
+    verify_process_2("202604071700", "202604090900")