updated app.py
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user