我关闭了redis以检查err-handle,但它仍在重新连接
const redis = new Redis(
Object.assign({}, config.redis.server, {
retryStrategy(times) {
return Math.min(times * 100, 3000);
}
})
)
redis.on('error', err => {
console.log(`redis error:${err.toString()}`);
});
错误消息日志:
redis error:Error: connect ECONNREFUSED 127.0.0.1:6379
答案 0 :(得分:0)
此问题通过代码解决:
type="button"