|
|
@ -219,16 +219,24 @@ class Worker:
|
|
|
|
connection.client_setname(self.name)
|
|
|
|
connection.client_setname(self.name)
|
|
|
|
except redis.exceptions.ResponseError:
|
|
|
|
except redis.exceptions.ResponseError:
|
|
|
|
warnings.warn(
|
|
|
|
warnings.warn(
|
|
|
|
'CLIENT command not supported, setting ip_address to unknown',
|
|
|
|
'CLIENT SETNAME command not supported, setting ip_address to unknown',
|
|
|
|
Warning
|
|
|
|
Warning
|
|
|
|
)
|
|
|
|
)
|
|
|
|
self.ip_address = 'unknown'
|
|
|
|
self.ip_address = 'unknown'
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.ip_address = [
|
|
|
|
client_adresses = [
|
|
|
|
client['addr']
|
|
|
|
client['addr']
|
|
|
|
for client in connection.client_list()
|
|
|
|
for client in connection.client_list()
|
|
|
|
if client['name'] == self.name
|
|
|
|
if client['name'] == self.name
|
|
|
|
][0]
|
|
|
|
]
|
|
|
|
|
|
|
|
if len(client_adresses) > 0:
|
|
|
|
|
|
|
|
self.ip_address = client_adresses[0]
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
warnings.warn(
|
|
|
|
|
|
|
|
'CLIENT LIST command not supported, setting ip_address to unknown',
|
|
|
|
|
|
|
|
Warning
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
self.ip_address = 'unknown'
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.hostname = None
|
|
|
|
self.hostname = None
|
|
|
|
self.pid = None
|
|
|
|
self.pid = None
|
|
|
|