try to avoid thread exception
This commit is contained in:
@@ -33,6 +33,8 @@ class CommandorPage:
|
|||||||
def _run(self, e: threading.Event, proxy, contact: ContactPojo, on_ready_for_otp, on_success):
|
def _run(self, e: threading.Event, proxy, contact: ContactPojo, on_ready_for_otp, on_success):
|
||||||
self.contact = contact
|
self.contact = contact
|
||||||
self.on_success_listener = on_success
|
self.on_success_listener = on_success
|
||||||
|
# reset otp_value to None
|
||||||
|
self.otp_value = None
|
||||||
with sync_playwright() as pwright:
|
with sync_playwright() as pwright:
|
||||||
firefox_user_agents = filter(lambda user_agent: "firefox" in user_agent.lower(), user_agent_list)
|
firefox_user_agents = filter(lambda user_agent: "firefox" in user_agent.lower(), user_agent_list)
|
||||||
firefox_user_agents_list = list(firefox_user_agents)
|
firefox_user_agents_list = list(firefox_user_agents)
|
||||||
@@ -97,6 +99,7 @@ class CommandorPage:
|
|||||||
return self.page.content()
|
return self.page.content()
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
self.logger.exception(error)
|
self.logger.exception(error)
|
||||||
|
self.browser.close()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def start_page(self, proxy, contact: ContactPojo, on_ready_for_otp, on_sucess) -> threading.Event:
|
def start_page(self, proxy, contact: ContactPojo, on_ready_for_otp, on_sucess) -> threading.Event:
|
||||||
|
|||||||
Reference in New Issue
Block a user