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

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

    评论

报告相同问题?

悬赏问题

  • ¥33 集成BiLSTM模型和GCN模型时,前模型的输出不匹配后模型的输入
  • ¥15 关于液体厚度提取,和铺展轨迹数据化处理
  • ¥20 对方微信是wxid如何添加成好友?或者转换成微信号?
  • ¥15 yolov5实验数据好,但是自己拍摄的照片检测结果差
  • ¥15 做过dali2.0认证的技术,
  • ¥15 一道python难题
  • ¥15 matlab 免疫算法
  • ¥50 可视化界面构建,实现信息模块功能
  • ¥15 基于bert-base-chinese的中文文本处理
  • ¥15 高价求抖音抓包技术,抖音抓包无网络问题