Browse Source

hypercorn_config.toml
配置文件修改

罗俊辉 1 year ago
parent
commit
f219825df2
2 changed files with 26 additions and 26 deletions
  1. 25 25
      applications/match_alg/recall.py
  2. 1 1
      hypercorn_config.toml

+ 25 - 25
applications/match_alg/recall.py

@@ -356,31 +356,31 @@ def recall_videos(params, trace_id):
     user_id = gh_id_dict[ghId]['uid']
 
     # 在外面搜索视频
-    payload = {
-        "ghId": ghId,
-        "search_keys": [title],
-        "trace_id": trace_id
-    }
-    # print(payload)
-    url = "http://0.0.0.0:8112/search_videos"
-    requests.post(url, json=payload)
-    # print("请求完成")
-    time.sleep(15)
-    select_sql = "select video_id, video_title from crawler_video where platform='weixin_search' and user_id = '{}' order by update_time DESC limit 10".format(
-        user_id)
-    out_video_list = select(sql=select_sql)
-    dir_path = os.path.join(os.getcwd(), 'applications', 'static', "out_videos")
-    os.makedirs(os.path.dirname(dir_path), exist_ok=True)
-    done_list = os.listdir(dir_path)
-    process_list = [
-        (
-            i[1],
-            trace_id,
-            os.path.join(dir_path, "{}.json".format(i[0]))
-        ) for i in out_video_list if not "{}.json".format(i[0]) in done_list
-    ]
-    with ThreadPoolExecutor(max_workers=10) as pool:
-        pool.map(ask_kimi_and_save_to_local, process_list)
+    # payload = {
+    #     "ghId": ghId,
+    #     "search_keys": [title],
+    #     "trace_id": trace_id
+    # }
+    # # print(payload)
+    # url = "http://61.48.133.26:8111/search_videos"
+    # requests.post(url, json=payload)
+    # # print("请求完成")
+    # time.sleep(15)
+    # select_sql = "select video_id, video_title from crawler_video where platform='weixin_search' and user_id = '{}' order by update_time DESC limit 10".format(
+    #     user_id)
+    # out_video_list = select(sql=select_sql)
+    # dir_path = os.path.join(os.getcwd(), 'applications', 'static', "out_videos")
+    # os.makedirs(os.path.dirname(dir_path), exist_ok=True)
+    # done_list = os.listdir(dir_path)
+    # process_list = [
+    #     (
+    #         i[1],
+    #         trace_id,
+    #         os.path.join(dir_path, "{}.json".format(i[0]))
+    #     ) for i in out_video_list if not "{}.json".format(i[0]) in done_list
+    # ]
+    # with ThreadPoolExecutor(max_workers=10) as pool:
+    #     pool.map(ask_kimi_and_save_to_local, process_list)
 
     # 在两边召回视频
     # pq_videos

+ 1 - 1
hypercorn_config.toml

@@ -1,5 +1,5 @@
 reload = true
-bind = "0.0.0.0:8112"
+bind = "0.0.0.0:8111"
 workers = 2
 keep_alive_timeout = 60  # 保持连接的最大秒数,根据需要调整
 graceful_timeout = 30    # 重启或停止之前等待当前工作完成的时间