From 4db01ec6da52455f509495bf0c7dabaa14325221 Mon Sep 17 00:00:00 2001 From: Franklin-F Date: Sat, 31 May 2025 03:43:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=B9=B6=E5=8F=91?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E4=BB=A5?= =?UTF-8?q?=E6=8F=90=E9=AB=98=E6=90=9C=E7=B4=A2=E6=95=88=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/main.py b/main.py index 8dff8d6..afb313c 100644 --- a/main.py +++ b/main.py @@ -358,27 +358,20 @@ def integrate_data_parallel(): if not tasks: time.sleep(10) continue - for payload, kitem in tasks: - proxname = proxiesdict.get(kitem['rn']) - print(proxname) - h = gettoken(proxname) - print(h) - v_list = get_searchInfo(kitem['keyword'], kitem['level'], h, proxname) - # futures = [ - # executor.submit(search_worker, payload, kitem, flag) - # for payload, kitem in tasks - # ] - # - # # 统计回滚 - # rollback = {0: [], 1: [], 2: []} - # - # for fut in concurrent.futures.as_completed(futures): - # ok, f_flag, payload, kitem, v_list = fut.result() - # - # if not ok: - # rollback[f_flag].append(payload) - # continue + futures = [ + executor.submit(search_worker, payload, kitem, flag) + for payload, kitem in tasks + ] + # 统计回滚 + rollback = {0: [], 1: [], 2: []} + + for fut in concurrent.futures.as_completed(futures): + ok, f_flag, payload, kitem, v_list = fut.result() + + if not ok: + rollback[f_flag].append(payload) + continue for item in v_list: if not v_list: