From f5a803303f0148d98fc09a1e167e10931bdc0f5f Mon Sep 17 00:00:00 2001 From: robk-tahoe Date: Fri, 1 Feb 2008 18:57:31 -0700 Subject: [PATCH] stats: fix service issues having moved inititalisation into startService to handle tub init cleanly, I neglected the up-call to startService, which wound up not starting the load_monitor. also I changed the 'running' attribute to 'started' since 'running' is the name used internally by MultiService itself. --- src/allmydata/stats.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/allmydata/stats.py b/src/allmydata/stats.py index 7e3c64f6..1d060d6e 100644 --- a/src/allmydata/stats.py +++ b/src/allmydata/stats.py @@ -26,21 +26,21 @@ class LoadMonitor(service.MultiService): service.MultiService.__init__(self) self.provider = provider self.warn_if_delay_exceeds = warn_if_delay_exceeds - self.running = False + self.started = False self.last = None self.stats = deque() def startService(self): - if not self.running: - self.running = True + if not self.started: + self.started = True reactor.callLater(self.loop_interval, self.loop) service.MultiService.startService(self) def stopService(self): - self.running = False + self.started = False def loop(self): - if not self.running: + if not self.started: return now = time.time() if self.last is not None: @@ -86,6 +86,7 @@ class StatsProvider(foolscap.Referenceable, service.MultiService): nickname = self.node.get_config('nickname') self.node.tub.connectTo(self.gatherer_furl, self._connected, nickname) d.addCallback(connect) + service.MultiService.startService(self) def count(self, name, delta): val = self.counters.setdefault(name, 0) -- 2.45.2