12 lines
335 B
Python
12 lines
335 B
Python
import json
|
|
from flask import request, current_app, jsonify
|
|
from db import redis_client
|
|
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'))
|
|
return [v['ip'] for k, v in consumer_list.items()]
|