如何初始化我的redis_store以建立连接池。我想添加池属性{pool_size:10,pool_timeout:10}我添加了connection_pool gem
Example::Application.config.session_store :redis_store,
servers: { host: 'localhost',
port: 6379,
db: 0,
namespace: 'session'
},
expires_in: 25.hours,
它在服务器启动时出错。如果我添加如下的内容;
Example::Application.config.session_store :redis_store,
servers: { host: 'localhost',
port: 6379,
db: 0,
namespace: 'session'
},
expires_in: 25.hours,
{ pool_size: 10, pool_timeout: 10 }
答案 0 :(得分:1)
在我执行完代码后,我遇到了一个简单的SyntaxError
。可能是你的问题,因为正确指定选项应该是:
Example::Application.config.session_store :redis_store,
servers: { host: 'localhost',
port: 6379,
db: 0,
namespace: 'session'
},
expires_in: 25.hours,
pool_size: 10,
pool_timeout: 10