How to get client addr from redis?

883 Views Asked by At

I am testing Redis in heroku. I have simple flask app that can create the redis client and kill the client but ...

@app.route('/client-status')
def client_status():
    redis.client_setname("first")
    redis.client_kill('addr') #10.157.2.68:60097
    return "Success"

The question is how to get addr ? I know a way to get name redis.client_getname()...

1

There are 1 best solutions below

2
Mir Ilias On BEST ANSWER

you should use the command CLIENT LIST http://redis.io/commands/client-list to get all the information about the client connections server, and then retrieve the address field