Skip to content
Snippets Groups Projects
Commit 5a884eff authored by Erik Reid's avatar Erik Reid
Browse files

unique-ify locations in peer-info response

parent 67bffc9e
No related branches found
No related tags found
No related merge requests found
......@@ -301,7 +301,6 @@ def peer_info(address):
cache_key = f'classifier-cache:peer:{address}'
result = r.get(cache_key)
result = None
if result:
result = result.decode('utf-8')
else:
......@@ -335,6 +334,7 @@ def peer_info(address):
l = [_location_from_service_dict(s) for s in i['services']]
result['locations'] += l
result['locations'] = _unique_dicts_from_list(result['locations'])
result = json.dumps(result)
# cache this data for the next call
r.set(cache_key, result.encode('utf-8'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment