Skip to content

Commit 6575d7f

Browse files
BUG: inserted sleep before returning from wait_for_file method
1 parent c3184de commit 6575d7f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

botcity/web/bot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,7 @@ def wait_for_file(self, path, timeout=60000):
18901890
if self.browser == Browser.FIREFOX and os.path.exists(path + '.part'):
18911891
# if *.part exists, the download is not completed.
18921892
continue
1893+
self.sleep(config.DEFAULT_SLEEP_AFTER_ACTION)
18931894
return True
18941895
self.sleep(config.DEFAULT_SLEEP_AFTER_ACTION)
18951896

@@ -1948,7 +1949,8 @@ def wait_for_new_file(self, path=None, file_extension="", current_count=0, timeo
19481949
elapsed_time = (time.time() - start_time) * 1000
19491950
if elapsed_time > timeout:
19501951
return None
1951-
pdf_count = self.get_file_count(path, f"*{file_extension}")
1952-
if pdf_count == current_count + 1:
1952+
file_count = self.get_file_count(path, f"*{file_extension}")
1953+
if file_count == current_count + 1:
1954+
self.sleep(config.DEFAULT_SLEEP_AFTER_ACTION)
19531955
return self.get_last_created_file(path, f"*{file_extension}")
19541956
self.sleep(config.DEFAULT_SLEEP_AFTER_ACTION)

0 commit comments

Comments
 (0)