Fixed customers endpoint
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Füleki Fábián 2020-05-08 19:48:31 +02:00
parent eb03474392
commit 67d71fa43e

View File

@ -8,6 +8,13 @@ from flask_classful import FlaskView
class ConsumersView(FlaskView):
def get(self):
consumer_list = json.loads((redis_client.get("consumer_list") or b"{}").decode('utf-8'))
current_app.logger.warning(jsonify([v['ip'] for k, v in consumer_list.items()]))
return jsonify([v['ip'] for k, v in consumer_list.items()])
keys = redis_client.keys('producer_*')
list_of_customer_ips = []
for key in keys:
info = json.loads((redis_client.get(key) or b"{}").decode('utf-8'))
list_of_customer_ips.append(info['ip'])
return jsonify(list_of_customer_ips)