Commit 34044e8b authored by Georg von Zengen's avatar Georg von Zengen

try to catch keyerror in cleaner if time is missing

parent c7af4617
......@@ -24,8 +24,14 @@ def alfred_cleaner(config, alfred_channels,batadv):
for channel in alfred_channels.keys():
to_del = []
for node in alfred_channels[channel].keys():
if time.time() - alfred_channels[channel][node]['time'] > config['update_interval'] * 2:
to_del.append(node)
try:
if time.time() - alfred_channels[channel][node]['time'] > config['update_interval'] * 2:
to_del.append(node)
except KeyError as e:
print(e)
print("no time in: "+ str(alfred_channels[channel][node]))
alfred_channels[channel][node]['time'] = time.time()
for node in to_del:
del alfred_channels[channel][node]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment