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

Setup timeout to redis connexion #59

Open
LucCADORET opened this issue Sep 20, 2018 · 2 comments
Open

Setup timeout to redis connexion #59

LucCADORET opened this issue Sep 20, 2018 · 2 comments

Comments

@LucCADORET
Copy link

Hi, I figured there was no timeout to the redis connexion, and both need to up when tipboard starts, otherwise it'll the crash. Since I am trying to dockerize everything and put that in some swarm, I now have redis and tipboard that start separately in 2 different containers, that start in an unpredictable order, meaning that tipboard won't work if it boots before redis. Would it be possible to configure a timeout for the redis connexion ? That way tipboard could way for a specific amout of time before giving up on booting.

Nice tool btw, props to the team.

@vi4m
Copy link
Contributor

vi4m commented Oct 12, 2018

Yes, it's possible right away.

In settings.py file, find line:

REDIS_SYNC = dict(
    host=REDIS_HOST,
    port=REDIS_PORT,
    password=REDIS_PASSWORD,
    db=REDIS_DB,
)

modify it to something like this:

REDIS_SYNC = dict(
    host=REDIS_HOST,
    port=REDIS_PORT,
    password=REDIS_PASSWORD,
    db=REDIS_DB,
    socket_timeout=10,
    socket_connect_timeout=1000
)

You can use any of options from here:

https://redis-py.readthedocs.io/en/latest/#contents

@the-maux
Copy link

the-maux commented Aug 6, 2019

Thanks to Django, this is resolved in my pr #70

Django can start without redis to be up, only when a client connection is started that become to be a requirements, even if redis is slow to start, django will start automaticaly the connection again after a failed.

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

3 participants