Explorar el Código

匹配率监测上线

罗俊辉 hace 10 meses
padre
commit
5ff5e50e44
Se han modificado 2 ficheros con 7 adiciones y 8 borrados
  1. 6 6
      match_rate_app.py
  2. 1 2
      re_search.py

+ 6 - 6
match_rate_app.py

@@ -41,12 +41,12 @@ def job():
     error_sheet_id = "67wu2O"
     for item in error_list:
         F.prepend_value(sheet_id=error_sheet_id, values=[["*****"]], ranges="A2:A2")
-        F.insert_value(sheet_id=error_sheet_id, values=[[today_str] + item], ranges="A2:D2")
+        F.insert_value(sheet_id=error_sheet_id, values=[[datetime.utcfromtimestamp(e_time / 1000).strftime("%Y%m%d")] + item], ranges="A2:D2")
 
 
 if __name__ == '__main__':
-    job()
-    # schedule.every().day.at("01:00").do(job)
-    # while True:
-    #     schedule.run_pending()
-    #     time.sleep(1)
+    # job()
+    schedule.every().day.at("01:00").do(job)
+    while True:
+        schedule.run_pending()
+        time.sleep(1)

+ 1 - 2
re_search.py

@@ -7,8 +7,7 @@ import pymysql
 import requests
 
 
-
-trace_id = "search-08fa6f87-aaa2-4462-9f57-f5ca72219136-1716827402"
+trace_id = "search-5b5343dc-b6a8-4f65-9e6b-e04b9961e530-1716955405"
 sql = f"""select trace_id, article_title, article_text, gh_id, account_name from long_articles_video where trace_id = '{trace_id}';"""
 connection = pymysql.connect(
         host="rm-bp1159bu17li9hi94.mysql.rds.aliyuncs.com",  # 数据库IP地址,内网地址