summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Hennion <nicolashennion@gmail.com>2013-03-19 00:47:24 -0700
committerNicolas Hennion <nicolashennion@gmail.com>2013-03-19 00:47:24 -0700
commita0e1380400c7be2e2b07265341ffe19591bfedd2 (patch)
treeb8c432b1227e702594a4ce3ed92189d41631ca7e
parent3feb3b3965d20de2b786e4a43dc9a073c59afbb9 (diff)
parent5540b0a7674e825d7e64177c5601a0fbc8b325c4 (diff)
Merge pull request #217 from jrenner/master
Fixes #215 changed timer to only reset when an update is run, not just an attempt to update
-rw-r--r--glances/glances.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/glances/glances.py b/glances/glances.py
index 655b2b76..5e180597 100644
--- a/glances/glances.py
+++ b/glances/glances.py
@@ -3192,6 +3192,9 @@ class GlancesInstance():
"""
def __init__(self, cached_time=1):
+ # cached_time is the minimum time interval between stats updates
+ # i.e. XML/RPC calls will not retrieve updated info until the time
+ # since last update is passed (will retrieve old cached info instead)
self.timer = Timer(0)
self.cached_time = cached_time
@@ -3199,7 +3202,7 @@ class GlancesInstance():
# Never update more than 1 time per cached_time
if self.timer.finished():
stats.update()
- self.timer = Timer(self.cached_time)
+ self.timer = Timer(self.cached_time)
def init(self):
# Return the Glances version