Skip to content

Commit 200fea5

Browse files
committed
Restore pbar after modifications completed
1 parent 637cd65 commit 200fea5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

instagram_monitor.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7039,6 +7039,8 @@ def fetch_usernames_paginated(bot, get_generator_fn, max_per_batch, total_limit,
70397039
thread_pbar.unit = batch_info
70407040
thread_pbar.refresh()
70417041
if stop_event is not None and stop_event.is_set():
7042+
if thread_pbar:
7043+
thread_pbar.unit = batch_info_orig # restore units back to original state to avoid observed problems
70427044
return results
70437045
# If a Web Dashboard "recheck" is pending, shorten the current inter-batch wait so the
70447046
# in-progress fetch completes sooner. Do not consume the event here: the recheck applies
@@ -7051,6 +7053,8 @@ def fetch_usernames_paginated(bot, get_generator_fn, max_per_batch, total_limit,
70517053
# Check for proxy changes from web dashboard
70527054
refresh_proxy_if_needed(bot, user)
70537055
if recheck_pending:
7056+
if thread_pbar:
7057+
thread_pbar.unit = batch_info_orig # restore units back to original state to avoid observed problems
70547058
break
70557059

70567060
wait_chunk = min(1, sleep_remaining)
@@ -7059,6 +7063,8 @@ def fetch_usernames_paginated(bot, get_generator_fn, max_per_batch, total_limit,
70597063
else:
70607064
time.sleep(wait_chunk)
70617065
sleep_remaining -= wait_chunk
7066+
if thread_pbar:
7067+
thread_pbar.unit = batch_info_orig # restore units back to original state to avoid observed problems
70627068

70637069
return results
70647070

0 commit comments

Comments
 (0)