fix eternal loop

This commit is contained in:
Andrey Pohilko 2012-10-02 15:45:14 +04:00
parent eb4fbdef94
commit 84baf75d76
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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