Replies: 1 comment 1 reply
-
I'm surprised you see this kind of errors, since the Redis Py client gracefully handle disconnected connections and automatically reconnects: redis/redis-py#932 Are you sure the error comes from a disconnected connection? Or maybe something in-between (like a network gateway) prevents the client from reconnecting? The exception and stacktrace you're getting could be useful to understand what happens exactly. Anyway, there is something surprising in the code snippet you shared: return RedisStrategy(await redis, lifetime_seconds=86400) the return RedisStrategy(redis, lifetime_seconds=3600) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am using the
get_redis_strategy
to store the sessions in redis and what I noticed is that after the process is running for some time (hours) and no one logged in/out the redis session times out. When this happens and someone tries to login, the user will see a server error (because the session died) and only after the process restarted, it will work again.I am using the asyncio like this:
Does anyone has a suggestion on how to use a pool that will use a new connection for each
get_redis_strategy
after a session expired or should I approach this differently?Thanks,
bert
Beta Was this translation helpful? Give feedback.
All reactions