From 84baf75d765f9eac5e926aa7a737b71d71c01358 Mon Sep 17 00:00:00 2001 From: Andrey Pohilko Date: Tue, 2 Oct 2012 15:45:14 +0400 Subject: [PATCH] fix eternal loop --- Tank/Plugins/ConsoleScreen.py | 1 + Tank/Plugins/Monitoring.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Tank/Plugins/ConsoleScreen.py b/Tank/Plugins/ConsoleScreen.py index 07297bd..6db43c6 100644 --- a/Tank/Plugins/ConsoleScreen.py +++ b/Tank/Plugins/ConsoleScreen.py @@ -11,6 +11,7 @@ import os import struct import termios +# TODO: 2 either detect or disable colors in proper situations def get_terminal_size(): ''' Gets width and height of terminal viewport diff --git a/Tank/Plugins/Monitoring.py b/Tank/Plugins/Monitoring.py index c50b279..c3dfba6 100644 --- a/Tank/Plugins/Monitoring.py +++ b/Tank/Plugins/Monitoring.py @@ -77,9 +77,11 @@ class MonitoringPlugin(AbstractPlugin): try: self.monitoring.prepare() self.monitoring.start() - while not self.monitoring.first_data_received: + count = 0 + while not self.monitoring.first_data_received and count < 15 * 5: time.sleep(0.2) self.monitoring.poll() + count += 1 except Exception, exc: if self.die_on_fail: raise exc