Skip to content

Commit

Permalink
fix: corruption/freezes in the terminal ui (#141)
Browse files Browse the repository at this point in the history
Background print() statements and tqdm progress bars were causing problems.
  • Loading branch information
jug-dev authored Mar 27, 2023
1 parent 2faae5b commit 705ddce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions worker/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,13 @@ def __init__(self, worker_name=None, apikey=None, url="https://stablehorde.net")
self.cpu_average = []
self.audio_alerts = False
self.last_audio_alert = 0
self.stdout = DequeOutputCollector()
self.stderr = DequeOutputCollector()

def initialise(self):
# Suppress stdout / stderr
sys.stderr = os.devnull
sys.stdout = os.devnull
sys.stderr = self.stderr
sys.stdout = self.stdout
if self.use_log_file:
self.open_log()
else:
Expand Down

0 comments on commit 705ddce

Please sign in to comment.