This commit is contained in:
parent
a60ee01ae1
commit
a1ca3285ab
5
app.py
5
app.py
@ -7,6 +7,7 @@ import os
|
||||
import redis
|
||||
import json
|
||||
import logging
|
||||
import socket
|
||||
|
||||
"""
|
||||
Scheduler
|
||||
@ -36,6 +37,9 @@ def main():
|
||||
logging.debug('Get consumer list from redis at first: Done')
|
||||
temp_dict = { }
|
||||
|
||||
hostname = socket.gethostname()
|
||||
current_ip = socket.gethostbyname(host_name)
|
||||
|
||||
for ip in ip_list:
|
||||
try:
|
||||
# request synchronization
|
||||
@ -65,7 +69,6 @@ def main():
|
||||
if response.status_code == 200:
|
||||
temp_dict[response.json()['uuid']] = {'ip': ip}
|
||||
|
||||
|
||||
# update the dictionary of the currently available consumers
|
||||
consumer_list_redis.update(temp_dict)
|
||||
r.set('consumer_list', json.dumps(consumer_list_redis).encode('utf-8'))
|
||||
|
Reference in New Issue
Block a user