Add anonymous redis session expiration configuration

This commit is contained in:
Patrick Tombez
2020-01-29 16:45:59 +01:00
parent 23e97ab14b
commit 17b992a6c4
3 changed files with 14 additions and 2 deletions
+2
View File
@@ -42,6 +42,7 @@ port = int(os.environ.get('ODOO_SESSION_REDIS_PORT', 6379))
prefix = os.environ.get('ODOO_SESSION_REDIS_PREFIX')
password = os.environ.get('ODOO_SESSION_REDIS_PASSWORD')
expiration = os.environ.get('ODOO_SESSION_REDIS_EXPIRATION')
anon_expiration = os.environ.get('ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS')
@lazy_property
@@ -54,6 +55,7 @@ def session_store(self):
redis_client = redis.Redis(host=host, port=port, password=password)
return RedisSessionStore(redis=redis_client, prefix=prefix,
expiration=expiration,
anon_expiration=anon_expiration,
session_class=http.OpenERPSession)