[PR #69] [MERGED] Multiple pbar fixes #68

Closed
opened 2026-02-27 20:05:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/misiektoja/instagram_monitor/pull/69
Author: @tomballgithub
Created: 2/21/2026
Status: Merged
Merged: 2/24/2026
Merged by: @misiektoja

Base: devHead: pbar_fix


📝 Commits (7)

  • a3a31af During pbar updates, send random prints only to log, not screen
  • 95975da Use current console width to set width of pbar. Screen width could be less than HORIZONTAL_LINE, which causes pbar to not be able to /r and update same line. This specifically was noticed when using RDP to access Windows Terminal but the RDP was disconnected, causing screen width to go to 102
  • 46e973d Debug statement occurs before pbar is closed, so it needs to use tqdm.write
  • 7bdef2e Use increment when calculating names/req statistic.
  • 7a4f1f1 Use increment when calculating time remaining for pbar
  • f4f5a11 Calculate rate on first pbar update, rather than using 0 per TQDM
  • ea35b07 fix(pbar): scope output suppression per-thread, bound ncols safely and remove unintended close debug output

📊 Changes

1 file changed (+33 additions, -8 deletions)

View changed files

📝 instagram_monitor.py (+33 -8)

📄 Description

  1. During pbar updates, send random prints only to log, not screen. I tested this in single account mode. The only downside is you could miss a message that would have occurred during the pbar update. However, it's really a corner case of clicking things in the web dashboard that was causing pbar screen update issues. Those messages are not critical. If you don't want to implement this, I understand.

  2. Use current console width to set width of pbar. Screen width could be less than HORIZONTAL_LINE, which causes pbar to not be able to /r and update the same line. This specifically was noticed when using RDP to access Windows Terminal but the RDP was disconnected, causing screen width to go to 102. The code should be OS independent, but I tested on Windows.

Downloading Followings: 0%| | 0/4454 [Initi* Downloading Followings: 0%| | 12/4454 [0.0 names/req, reqs=1, mins=0.2, * Downloading Followings: 1%|▏ | 24/4454 [6.0 names/req, reqs=2, mins=0.3, r* Downloading Followings: 1%|▏ | 36/4454 [8.0 names/req, reqs=3, mins=0.4, r* Downloading Followings: 1%|▎ | 48/4454 [9.0 names/req, reqs=4, mins=0.5, r* Downloading Followings: 1%|▎ | 60/4454 [9.6 names/req, reqs=5, mins=0.5, r* Downloading Followings: 2%|▍ | 72/4454 [10.0 names/req, reqs=6, mins=0.6, r* Downloading Followings: 2%|▍ | 84/4454 [10.3 names/req, reqs=7, mins=0.7, r* Downloading Followings: 2%|▌ | 96/4454 [10.5 names/req, reqs=8, mins=0.8, remain=34.0]

  1. Debug statement occurs before pbar is closed, so it needs to use tqdm.write

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/misiektoja/instagram_monitor/pull/69 **Author:** [@tomballgithub](https://github.com/tomballgithub) **Created:** 2/21/2026 **Status:** ✅ Merged **Merged:** 2/24/2026 **Merged by:** [@misiektoja](https://github.com/misiektoja) **Base:** `dev` ← **Head:** `pbar_fix` --- ### 📝 Commits (7) - [`a3a31af`](https://github.com/misiektoja/instagram_monitor/commit/a3a31aff3af8b0df9c4b87d507ea10924a5b4ec5) During pbar updates, send random prints only to log, not screen - [`95975da`](https://github.com/misiektoja/instagram_monitor/commit/95975da9ec3330123843104049b96aa451ad16d8) Use current console width to set width of pbar. Screen width could be less than HORIZONTAL_LINE, which causes pbar to not be able to /r and update same line. This specifically was noticed when using RDP to access Windows Terminal but the RDP was disconnected, causing screen width to go to 102 - [`46e973d`](https://github.com/misiektoja/instagram_monitor/commit/46e973dd1ee976df897599c3558a9fef66a1678e) Debug statement occurs before pbar is closed, so it needs to use tqdm.write - [`7bdef2e`](https://github.com/misiektoja/instagram_monitor/commit/7bdef2e58b3359af8204fd9fbd1bacee6be6e9e2) Use increment when calculating names/req statistic. - [`7a4f1f1`](https://github.com/misiektoja/instagram_monitor/commit/7a4f1f1ea4abae829a7191c38238c6741f233bbb) Use increment when calculating time remaining for pbar - [`f4f5a11`](https://github.com/misiektoja/instagram_monitor/commit/f4f5a112c28fa4f0290f4d972eb28ed74a8985dd) Calculate rate on first pbar update, rather than using 0 per TQDM - [`ea35b07`](https://github.com/misiektoja/instagram_monitor/commit/ea35b0752e9d06d8e322261baf2ad90d9c45c4b3) fix(pbar): scope output suppression per-thread, bound ncols safely and remove unintended close debug output ### 📊 Changes **1 file changed** (+33 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `instagram_monitor.py` (+33 -8) </details> ### 📄 Description 1. During pbar updates, send random prints only to log, not screen. I tested this in single account mode. The only downside is you could miss a message that would have occurred during the pbar update. However, it's really a corner case of clicking things in the web dashboard that was causing pbar screen update issues. Those messages are not critical. If you don't want to implement this, I understand. 2. Use current console width to set width of pbar. Screen width could be less than HORIZONTAL_LINE, which causes pbar to not be able to /r and update the same line. This specifically was noticed when using RDP to access Windows Terminal but the RDP was disconnected, causing screen width to go to 102. The code should be OS independent, but I tested on Windows. `Downloading Followings: 0%| | 0/4454 [Initi* Downloading Followings: 0%| | 12/4454 [0.0 names/req, reqs=1, mins=0.2, * Downloading Followings: 1%|▏ | 24/4454 [6.0 names/req, reqs=2, mins=0.3, r* Downloading Followings: 1%|▏ | 36/4454 [8.0 names/req, reqs=3, mins=0.4, r* Downloading Followings: 1%|▎ | 48/4454 [9.0 names/req, reqs=4, mins=0.5, r* Downloading Followings: 1%|▎ | 60/4454 [9.6 names/req, reqs=5, mins=0.5, r* Downloading Followings: 2%|▍ | 72/4454 [10.0 names/req, reqs=6, mins=0.6, r* Downloading Followings: 2%|▍ | 84/4454 [10.3 names/req, reqs=7, mins=0.7, r* Downloading Followings: 2%|▌ | 96/4454 [10.5 names/req, reqs=8, mins=0.8, remain=34.0]` 3. Debug statement occurs before pbar is closed, so it needs to use tqdm.write --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:05:17 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/instagram_monitor#68
No description provided.