Update RRDs of offline nodes, ignore key errors
parent
dc8171dbd6
commit
ddcf8fbead
|
@ -31,11 +31,14 @@ class RRD(object):
|
||||||
node_count = 0
|
node_count = 0
|
||||||
client_count = 0
|
client_count = 0
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
|
try:
|
||||||
if node['flags']['online']:
|
if node['flags']['online']:
|
||||||
node_count += 1
|
node_count += 1
|
||||||
client_count += node['statistics']['clients']
|
client_count += node['statistics']['clients']
|
||||||
rrd = NodeRRD(os.path.join(self.dbPath, node['nodeinfo']['node_id'] + '.rrd'), node)
|
rrd = NodeRRD(os.path.join(self.dbPath, node['nodeinfo']['node_id'] + '.rrd'), node)
|
||||||
rrd.update()
|
rrd.update()
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
self.globalDb.update(node_count, client_count)
|
self.globalDb.update(node_count, client_count)
|
||||||
|
|
||||||
def update_images(self):
|
def update_images(self):
|
||||||
|
|
Loading…
Reference in New Issue