adolph_1 2019-10-12 13:51 采纳率: 16.7%
浏览 2840

nodejs连接redis,经常掉线,然后重新连接,报错:Redis connection lost and command aborted. It might have been processed.

UnhandledPromiseRejectionWarning: AbortError: Redis connection lost and command aborted. It might have been processed.
    at RedisClient.flush_and_error (C:\workspace\MainData\node_modules\redis\index.js:362:23)
    at RedisClient.connection_gone (C:\workspace\MainData\node_modules\redis\index.js:664:14)
    at RedisClient.on_error (C:\workspace\MainData\node_modules\redis\index.js:410:10)
    at Socket.<anonymous> (C:\workspace\MainData\node_modules\redis\index.js:279:14)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:8088) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8088) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:8088) UnhandledPromiseRejectionWarning: AbortError: Redis connection lost and command aborted. It might have been processed.
    at RedisClient.flush_and_error (C:\workspace\MainData\node_modules\redis\index.js:362:23)
    at RedisClient.connection_gone (C:\workspace\MainData\node_modules\redis\index.js:664:14)
    at RedisClient.on_error (C:\workspace\MainData\node_modules\redis\index.js:410:10)
    at Socket.<anonymous> (C:\workspace\MainData\node_modules\redis\index.js:279:14)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:8088) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
  • 写回答

2条回答 默认 最新

  • @baby张 2019-10-12 14:56
    关注

    可以在node里用websocket 链接redis频道,并监听,里面写个轮循,断了就去重新链接,我的这个博客看下(websocket(Redis,node, react 三方处理)),希望对你有帮助。

    https://blog.csdn.net/weixin_43648947/article/details/100009465

    评论

报告相同问题?

悬赏问题

  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图