如何解决读取ECONNRESET公牛库错误

put*_*ana 1 queue heroku redis node.js bull

当我在 Node js 中使用bull库排队时出现错误,错误如下:

     Error: read ECONNRESET at TCP.onStreamRead 
    - - errno: -104,
   - - code: 'ECONNRESET',
   - - syscall: 'read'
   - - }
Run Code Online (Sandbox Code Playgroud)

 MaxRetriesPerRequestError: Reached the max retries per request limit (which is 20). Refer to "maxRetriesPerRequest" option for details.
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

const imageQueue = new Bull("imageQueue", process.env.REDIS_URL);
Run Code Online (Sandbox Code Playgroud)

put*_*ana 6

通过添加tls成功解决错误

const imageQueue = new Bull("imageQueue", process.env.REDIS_TLS_URL, {
  redis: { tls: { rejectUnauthorized: false } },
});
Run Code Online (Sandbox Code Playgroud)