dev-consumer-timeout-fix #7
@ -8,6 +8,13 @@ from flask_classful import FlaskView
|
|||||||
class ConsumersView(FlaskView):
|
class ConsumersView(FlaskView):
|
||||||
|
|
||||||
def get(self):
|
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()]))
|
keys = redis_client.keys('producer_*')
|
||||||
return jsonify([v['ip'] for k, v in consumer_list.items()])
|
|
||||||
|
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)
|
||||||
|
Reference in New Issue
Block a user