updated app.py

This commit is contained in:
2020-05-08 22:05:49 +02:00
parent 77e915c63e
commit 7ce88f1a74
3 changed files with 20 additions and 67 deletions

View File

@@ -4,6 +4,7 @@ import os
import json
import socket
import time
import logging
class RedisSuperStorage:
@@ -47,6 +48,7 @@ class RedisSuperStorage:
current_ip = socket.gethostbyname(host_name)
if current_ip != old_ip:
logging.info(f'IP changed: {old_ip} -> {current_ip}')
self.r.set('current_ip', current_ip.encode('utf-8'))
return current_ip != old_ip