dev-consumer-timeout-fix #7

Merged
ffabi1997 merged 5 commits from dev-consumer-timeout-fix into dev 2020-05-08 20:05:34 +02:00
Showing only changes of commit 67d71fa43e - Show all commits

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)