Fixed timeout not being used
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Füleki Fábián 2020-05-08 23:00:37 +02:00
parent 1158e6cc60
commit 0bea194f4a
2 changed files with 4 additions and 2 deletions

4
app.py
View File

@ -30,7 +30,9 @@ def main():
# set logging preferences
logging.basicConfig(filename='', level=logging.DEBUG)
redis_storage = RedisSuperStorage(os.environ.get('REDIS_URL', "redis://localhost:6379/0"), 5)
redis_storage = RedisSuperStorage(os.environ.get('REDIS_URL', "redis://localhost:6379/0"),
os.environ.get("CUSTOMER_TIMEOUT", 30))
consumer_communicator = ConsumerCommunicator(redis_storage)
producer_communicator = ProducerCommunicator(redis_storage)
ip_watchdog = IPWatchdog(redis_storage)

View File

@ -48,7 +48,7 @@ class RedisSuperStorage:
}
self.r.set(cust_key, json.dumps(info).encode('utf-8'))
self.r.expire(cust_key, os.environ.get("CUSTOMER_TIMEOUT",30))
self.r.expire(cust_key, self._timeout)
def get_current_ip(self) -> str:
ip = self.r.get('current_ip')