mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
IMP session_redis allow setting prefix through config file
This commit is contained in:
@@ -16,6 +16,7 @@ session_redis = True
|
|||||||
;session_redis_dbindex = 1
|
;session_redis_dbindex = 1
|
||||||
;session_redis_pass = x
|
;session_redis_pass = x
|
||||||
;session_redis_expire = 604800
|
;session_redis_expire = 604800
|
||||||
|
;session_redis_prefix = test
|
||||||
|
|
||||||
""",
|
""",
|
||||||
"summary": "",
|
"summary": "",
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class RedisSessionStore(werkzeug.contrib.sessions.SessionStore):
|
|||||||
self.expire = kwargs.get('expire', DEFAULT_SESSION_TIMEOUT)
|
self.expire = kwargs.get('expire', DEFAULT_SESSION_TIMEOUT)
|
||||||
if self.expire == DEFAULT_SESSION_TIMEOUT:
|
if self.expire == DEFAULT_SESSION_TIMEOUT:
|
||||||
self.expire = int(tools.config.get('session_redis_expire', DEFAULT_SESSION_TIMEOUT))
|
self.expire = int(tools.config.get('session_redis_expire', DEFAULT_SESSION_TIMEOUT))
|
||||||
self.key_prefix = kwargs.get('key_prefix', '')
|
self.key_prefix = kwargs.get('key_prefix', tools.config.get('session_redis_prefix', ''))
|
||||||
self.redis = redis.Redis(
|
self.redis = redis.Redis(
|
||||||
host=tools.config.get('session_redis_host', 'localhost'),
|
host=tools.config.get('session_redis_host', 'localhost'),
|
||||||
port=int(tools.config.get('session_redis_port', 6379)),
|
port=int(tools.config.get('session_redis_port', 6379)),
|
||||||
|
|||||||
Reference in New Issue
Block a user