fix: removed busy wait

This commit is contained in:
2026-08-14 15:30:44 +08:00
parent ba0b30a573
commit b004ac5d1c
+6 -7
View File
@@ -196,6 +196,10 @@ def main(driver: Chrome, logger = logging.getLogger('main')):
result = wb.active.cell(row, headers.index(header) + 1)
return result
def busy(driver: Chrome):
result = driver.find_elements(By.CSS_SELECTOR, ".io-ox-busy")
return result
try:
click("li[data-id='default0/Brouillons']", condition=EC.presence_of_element_located)
click("button[data-id='default0/Brouillons']", condition=EC.presence_of_element_located)
@@ -213,12 +217,6 @@ def main(driver: Chrome, logger = logging.getLogger('main')):
@classmethod
def perform(cls):
try: busy = driver.find_elements(By.CSS_SELECTOR, ".io-ox-busy")
except: busy = None
if busy:
sleep(parameters['interval'])
return True
if status == Status.RUNNING:
timer.start()
return False
@@ -450,7 +448,8 @@ def main(driver: Chrome, logger = logging.getLogger('main')):
flow.react(Wait)
click("ul.classic-toolbar button[aria-label='Edit copy']")
flow.react(Wait)
until(lambda x: busy(x))
until(lambda x: not busy(x))
locate("div.io-ox-mail-compose-window iframe", condition=EC.frame_to_be_available_and_switch_to_it)
if options.get('greet') and not (clean := False):