This commit is contained in:
parent
a1ca3285ab
commit
2a77c552bf
10
app.py
10
app.py
@ -76,6 +76,16 @@ def main():
|
||||
|
||||
logging.debug('Waiting for next turn')
|
||||
# wait for the next update time
|
||||
|
||||
if current_ip != socket.gethostbyname(host_name):
|
||||
current_ip = socket.gethostbyname(host_name)
|
||||
keys = redis.keys('producer_*')
|
||||
for key in keys:
|
||||
ip = redis.get(key)
|
||||
if not ip:
|
||||
continue
|
||||
response = requests.post(f"http://{ip}/ip", json={'uuid': os.environ['LOCAL_UUID'], 'ip': current_ip})
|
||||
logging.debug(response.status_code)
|
||||
time.sleep(30)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user