File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ async def subscribe_and_listen() -> None: # noqa: C901
3838
3939 try :
4040 # 使用独立连接
41- pubsub_client = RedisCli ()
41+ pubsub_client = RedisCli (socket_timeout = None )
4242 pubsub = pubsub_client .pubsub ()
4343 await pubsub .subscribe (settings .CACHE_PUBSUB_CHANNEL )
4444
Original file line number Diff line number Diff line change 1414sio = socketio .AsyncServer (
1515 client_manager = socketio .AsyncRedisManager (
1616 f'redis://:{ urllib .parse .quote (settings .REDIS_PASSWORD )} @{ settings .REDIS_HOST } :{ settings .REDIS_PORT } /{ settings .REDIS_DATABASE } ' ,
17+ redis_options = {
18+ 'socket_timeout' : None ,
19+ 'socket_connect_timeout' : settings .REDIS_TIMEOUT ,
20+ },
1721 ),
1822 async_mode = 'asgi' ,
1923 cors_allowed_origins = settings .CORS_ALLOWED_ORIGINS ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def __init__(
1616 port : int = settings .REDIS_PORT ,
1717 password : str = settings .REDIS_PASSWORD ,
1818 db : int = settings .REDIS_DATABASE ,
19- socket_timeout : int = settings .REDIS_TIMEOUT ,
19+ socket_timeout : int | None = settings .REDIS_TIMEOUT ,
2020 socket_connect_timeout : int = settings .REDIS_TIMEOUT ,
2121 * ,
2222 socket_keepalive : bool = True ,
You can’t perform that action at this time.
0 commit comments