nchan_redis_wait_after_connecting
配置在连接到 Redis 后,Nchan pub/sub 架构中的等待时间。
Scalable, flexible pub/sub server for the modern web
·
httpserverlocation
语法nchan_redis_wait_after_connecting time_in_seconds;
默认值none
上下文http, server, location
参数1
说明
nchan_redis_wait_after_connecting 指令指定在与 Redis 服务器建立连接后,Nchan 在继续处理之前应等待的时长。该等待期对于确保连接稳定并准备好处理消息发布或订阅请求至关重要。该参数通常以秒为单位表示。
配置示例
location /publish {
nchan_redis_wait_after_connecting 0.5;
nchan_pubsub;
}⚠
将等待时间设置得很短可能会导致连接不稳定,因 Redis 服务器尚未准备好而使请求失败。
⚠
如果 Redis 经常无法连接,请考虑增加等待时间以稳定连接。