diff options
author | Aleksey Lim <alsroot@sugarlabs.org> | 2013-02-20 14:22:11 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@sugarlabs.org> | 2013-02-20 14:22:11 (GMT) |
commit | 50d31c0552ea32cf0978018b480dc1ed4c30fb4e (patch) | |
tree | 8fe9d2506d8cda1b513192c1ac8a8123c95fee8a /sugar-network-node | |
parent | 9c8f1cd801eafc8c380a589f803d7e0dd9ee95ae (diff) |
Do not expose node stats object from NodeCommands
Diffstat (limited to 'sugar-network-node')
-rwxr-xr-x | sugar-network-node | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/sugar-network-node b/sugar-network-node index 7d71739..916f2fe 100755 --- a/sugar-network-node +++ b/sugar-network-node @@ -54,29 +54,24 @@ class Application(application.Daemon): volume = Volume(node.data_root.value) self.jobs.spawn(volume.populate) - node_stats = None - if stats.stats_node_step.value: - node_stats = stats.NodeStats(volume) - self.jobs.spawn(self._commit_stats, node_stats) - node_path = join(node.data_root.value, 'node') master_path = join(node.data_root.value, 'master') if exists(node_path): with file(node_path) as f: guid = f.read().strip() logging.info('Start %s node in slave mode', guid) - cp = SlaveCommands(guid, volume, node_stats) + cp = SlaveCommands(guid, volume) elif exists(master_path): with file(master_path) as f: guid = f.read().strip() logging.info('Start %s node in master mode', guid) - cp = MasterCommands(guid, volume, node_stats) + cp = MasterCommands(guid, volume) else: guid = db.uuid() with file(node_path, 'w') as f: f.write(guid) logging.info('Start new %s node in slave mode', guid) - cp = SlaveCommands(guid, volume, node_stats) + cp = SlaveCommands(guid, volume) logging.info('Listening for requests on %s:%s', node.host.value, node.port.value) @@ -109,11 +104,6 @@ class Application(application.Daemon): def shutdown(self): self.jobs.kill() - def _commit_stats(self, node_stats): - while True: - coroutine.sleep(stats.stats_node_step.value) - node_stats.commit() - # Let toolkit.http work in concurrence # XXX No DNS because `toolkit.network.res_init()` doesn't work otherwise |