can retry the contacts in error
This commit is contained in:
@@ -34,10 +34,13 @@ def start_book(start_number, end_number, store_choose_state=0, max_workers=10, p
|
||||
proxy)
|
||||
|
||||
|
||||
def recheck_the_captcha_error_contacts(store_type=0, mode: ModeEnum = ModeEnum.MANUAL):
|
||||
def recheck_the_captcha_error_contacts(on_no_contact_found, store_type=0, mode: ModeEnum = ModeEnum.MANUAL,
|
||||
max_workers=10):
|
||||
# get all the contacts in captcha error
|
||||
contact_list = params.local_db_manager.get_all_captcha_error_contacts()
|
||||
with ThreadPoolExecutor(max_workers=10) as executor:
|
||||
contact_list = params.mongo_store_manager.get_captcha_error_contacts_for_current_day()
|
||||
if len(contact_list) == 0:
|
||||
on_no_contact_found()
|
||||
with ThreadPoolExecutor(max_workers=max_workers) as executor:
|
||||
for errorContact in contact_list:
|
||||
contact = ContactPojo.get_contact_from_error_contact(errorContact)
|
||||
proxy = get_proxy()
|
||||
@@ -54,4 +57,4 @@ def get_proxy(proxy_type=ProxyType.BRIGHT_DATA):
|
||||
if __name__ == '__main__':
|
||||
# 修改联系人行,结束联系人行 第三个参数store等于0的时候是随机,传入1的时候是总店
|
||||
# start_book(16, 16, store_choose_state=0, proxy_type=0)
|
||||
recheck_the_captcha_error_contacts(0, mode=ModeEnum.AUTOMATIC)
|
||||
recheck_the_captcha_error_contacts(store_type=0, mode=ModeEnum.AUTOMATIC, on_no_contact_found=lambda: None)
|
||||
|
||||
Reference in New Issue
Block a user