gpt4 book ai didi

node.js - 收到新订阅者时 rs/pushd 崩溃

转载 作者:可可西里 更新时间:2023-11-01 11:12:03 25 4
gpt4 key购买 nike

我正在尝试使用 https://github.com/rs/pushd 作为推送通知服务器。

每当我尝试添加新订阅者时,服务器都会崩溃并显示以下堆栈跟踪:

/home/ec2-user/push_server/pushd/node_modules/redis/index.js:602
throw err;
^
TypeError: Cannot set property 'id' of null
at /home/ec2-user/push_server/pushd/lib/api.coffee:20:21
at /home/ec2-user/push_server/pushd/lib/subscriber.coffee:133:21
at try_callback (/home/ec2-user/push_server/pushd/node_modules/redis/index.js:592:9)
at RedisClient.return_reply (/home/ec2-user/push_server/pushd/node_modules/redis/index.js:685:13)
at HiredisReplyParser.<anonymous> (/home/ec2-user/push_server/pushd/node_modules/redis/index.js:321:14)
at HiredisReplyParser.emit (events.js:95:17)
at HiredisReplyParser.execute (/home/ec2-user/push_server/pushd/node_modules/redis/lib/parser/hiredis.js:43:18)
at RedisClient.on_data (/home/ec2-user/push_server/pushd/node_modules/redis/index.js:547:27)
at Socket.<anonymous> (/home/ec2-user/push_server/pushd/node_modules/redis/index.js:102:14)
at Socket.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:765:14)
at Socket.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:427:10)
at emitReadable (_stream_readable.js:423:5)
at readableAddChunk (_stream_readable.js:166:9)
at Socket.Readable.push (_stream_readable.js:128:10)
at TCP.onread (net.js:529:21)

这是应该添加新订阅者的命令(来自文档的示例),并导致崩溃:

curl -d proto=apns -d token=FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660 -d lang=fr -d badge=0 -d category=show -d contentAvailable=true http://localhost/subscribers

崩溃发生在订阅者被添加到数据库之前。

服务器是 AWS 上的 RHEL 微型实例

版本

Redis 服务器 2.8.19。

Node.js 0.10.36。

CoffeeScript 1.9.0

我们将不胜感激。

最佳答案

/lib/event.coffee
- throw new Error("Missing redis connection") if not redis?
+ throw new Error("Missing redis connection") if not @redis?
/lib/subscriber.coffee
- if info?.updated? # subscriber exists
+ if @info?.updated? # subscriber exists
# transform numeric value to number type
- for own key, value of info
+ for own key, value of @info

关于node.js - 收到新订阅者时 rs/pushd 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28350831/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com