mirror of
https://github.com/cwinfo/yggdrasil-map
synced 2024-11-22 12:50:27 +00:00
Don't lose edges for a week
This commit is contained in:
parent
faa9bbbc92
commit
63ac6ffc06
@ -70,8 +70,10 @@ class NodeDB:
|
|||||||
|
|
||||||
edges = []
|
edges = []
|
||||||
for e in db_edges:
|
for e in db_edges:
|
||||||
|
try:
|
||||||
edges.append(Edge(nodes[e['a']], nodes[e['b']]))
|
edges.append(Edge(nodes[e['a']], nodes[e['b']]))
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
return edges
|
return edges
|
||||||
|
|
||||||
def get_graph(self, time_limit):
|
def get_graph(self, time_limit):
|
||||||
|
@ -20,7 +20,9 @@ def load_graph_from_db(time_limit):
|
|||||||
config.from_pyfile('web_config.cfg')
|
config.from_pyfile('web_config.cfg')
|
||||||
|
|
||||||
with NodeDB(config) as db:
|
with NodeDB(config) as db:
|
||||||
return db.get_graph(time_limit)
|
nodes = db.get_nodes(time_limit)
|
||||||
|
edges = db.get_edges(nodes, 60*60*24*7)
|
||||||
|
return (nodes, edges)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user