diff --git a/app.py b/app.py index c9d5ff7..f86a6d2 100644 --- a/app.py +++ b/app.py @@ -22,7 +22,7 @@ sentry_sdk.init("https://0a106e104e114bc9a3fa47f9cb0db2f4@sentry.kmlabz.com/10") def get_initial_ip_list(): ip_list = os.environ['INITIAL_SERVERS'].split(',') - logging.debug('Initial ip list' + ", ".join(ip_list)) + logging.debug('Initial ip list ' + ", ".join(ip_list)) return ip_list @@ -48,7 +48,7 @@ def main(): if ip_changed: producer_communicator.push_ip_update(ipaddr) - time.sleep(os.environ.get("RUN_INTERVAL", 30)) + time.sleep(int(os.environ.get("RUN_INTERVAL", 10))) if __name__ == "__main__": diff --git a/redis_super_storage.py b/redis_super_storage.py index 78a3f43..056c544 100644 --- a/redis_super_storage.py +++ b/redis_super_storage.py @@ -48,7 +48,7 @@ class RedisSuperStorage: } self.r.set(cust_key, json.dumps(info).encode('utf-8')) - self.r.expire(cust_key, os.environ["CUSTOMER_TIMEOUT"]) + self.r.expire(cust_key, os.environ.get("CUSTOMER_TIMEOUT",30)) def get_current_ip(self) -> str: ip = self.r.get('current_ip')