Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis Pool is broken #51

Open
PhysTom88 opened this issue Nov 9, 2017 · 1 comment
Open

Redis Pool is broken #51

PhysTom88 opened this issue Nov 9, 2017 · 1 comment

Comments

@PhysTom88
Copy link

In session.py in the setting of the session.SESSION_REDIS_[VAR] varialbes after the check for if the session pool setting has been set does not work.

Currently:

if settings.SESSION_REDIS_POOL is not None:
    server_key, server = self.get_server(session_key, settings.SESSION_REDIS_POOL)
    self.connection_key = str(server_key)
    settings.SESSION_REDIS_HOST = getattr(server, 'host', 'localhost')
    settings.SESSION_REDIS_PORT = getattr(server, 'port', 6379)
    settings.SESSION_REDIS_DB = getattr(server, 'db', 0)
    settings.SESSION_REDIS_PASSWORD = getattr(server, 'password', None)
    settings.SESSION_REDIS_URL = getattr(server, 'url', None)
    settings.SESSION_REDIS_UNIX_DOMAIN_SOCKET_PATH = getattr(server,'unix_domain_socket_path', None)

...

Should be:

if settings.SESSION_REDIS_POOL is not None:
    server_key, server = self.get_server(
        session_key, settings.SESSION_REDIS_POOL)
    self.connection_key = str(server_key)
    settings.SESSION_REDIS_HOST = server.get('host', 'localhost')
    settings.SESSION_REDIS_PORT = server.get('port', 6379)
    settings.SESSION_REDIS_DB = server.get('db', 0)
    settings.SESSION_REDIS_PASSWORD = server.get('password', None)
    settings.SESSION_REDIS_URL = server.get('url', None)
    settings.SESSION_REDIS_UNIX_DOMAIN_SOCKET_PATH = server.get(
        'unix_domain_socket_path', None)```
@Allan-Nava
Copy link

In session.py in the setting of the session.SESSION_REDIS_[VAR] varialbes after the check for if the session pool setting has been set does not work.

Currently:

if settings.SESSION_REDIS_POOL is not None:
    server_key, server = self.get_server(session_key, settings.SESSION_REDIS_POOL)
    self.connection_key = str(server_key)
    settings.SESSION_REDIS_HOST = getattr(server, 'host', 'localhost')
    settings.SESSION_REDIS_PORT = getattr(server, 'port', 6379)
    settings.SESSION_REDIS_DB = getattr(server, 'db', 0)
    settings.SESSION_REDIS_PASSWORD = getattr(server, 'password', None)
    settings.SESSION_REDIS_URL = getattr(server, 'url', None)
    settings.SESSION_REDIS_UNIX_DOMAIN_SOCKET_PATH = getattr(server,'unix_domain_socket_path', None)

...

Should be:

if settings.SESSION_REDIS_POOL is not None:
    server_key, server = self.get_server(
        session_key, settings.SESSION_REDIS_POOL)
    self.connection_key = str(server_key)
    settings.SESSION_REDIS_HOST = server.get('host', 'localhost')
    settings.SESSION_REDIS_PORT = server.get('port', 6379)
    settings.SESSION_REDIS_DB = server.get('db', 0)
    settings.SESSION_REDIS_PASSWORD = server.get('password', None)
    settings.SESSION_REDIS_URL = server.get('url', None)
    settings.SESSION_REDIS_UNIX_DOMAIN_SOCKET_PATH = server.get(
        'unix_domain_socket_path', None)```

ANy newsss?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants