fengkx/NodeRSSBot

rss不正常更新

xinxijishuwyq opened this issue · 6 comments

今天git pull之后发现无法正常收到rss更新,多次回滚到
748e6b4
才正常--
系统archlinux,node版本v11.15.0

能否提供一下日志信息? BTW有没有重新安装依赖?

能否提供一下日志信息? BTW有没有重新安装依赖?
刚才通过

rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install
尝试了,问题依旧

能否提供一下日志信息? BTW有没有重新安装依赖?

NodeRSSBot git:(master) ✗ node index.js
info: Database file is in /home/ken/NodeRSSBot/data/database.db {"timestamp":"2019-06-20T12:14:44.684Z"}
info: Using language is zh-cn {"timestamp":"2019-06-20T12:14:44.694Z"}
info: send the latest 10 items for each feed {"timestamp":"2019-06-20T12:14:44.695Z"}
info: NodeRSSBot is ready {"timestamp":"2019-06-20T12:14:44.695Z"}
Debugger listening on ws://127.0.0.1:46209/cfe6a7db-81e0-4915-aff6-f999d1e4859c
For help, see: https://nodejs.org/en/docs/inspector
info: init tables in /home/ken/NodeRSSBot/data/database.db {"timestamp":"2019-06-20T12:14:44.754Z"}

我在本地又尝试了下,依旧有问题,但是如果打开调试再关掉就会好起来。。。
 ~/NodeRSSBot   master ●  node index.js
info: Database file is in /home/ken/NodeRSSBot/data/database.db {"timestamp":"2019-06-20T12:42:16.605Z"}
info: Using language is zh-cn {"timestamp":"2019-06-20T12:42:16.607Z"}
info: send the latest 10 items for each feed {"timestamp":"2019-06-20T12:42:16.608Z"}
info: NodeRSSBot is ready {"timestamp":"2019-06-20T12:42:16.608Z"}
Debugger listening on ws://127.0.0.1:46209/0900d6b7-c816-47b3-9086-0d5d5e79bf0b
For help, see: https://nodejs.org/en/docs/inspector
info: init tables in /home/ken/NodeRSSBot/data/database.db {"timestamp":"2019-06-20T12:42:16.630Z"}
Debugger attached.
Debugger listening on ws://127.0.0.1:46209/0900d6b7-c816-47b3-9086-0d5d5e79bf0b
For help, see: https://nodejs.org/en/docs/inspector
info: start fetching {"timestamp":"2019-06-20T12:44:16.901Z"}
info: fetch every 1 minutes {"timestamp":"2019-06-20T12:44:16.902Z"}
debug: fetching https://lorem-rss.herokuapp.com/feed?unit=second {"timestamp":"2019-06-20T12:44:16.917Z"}
debug: fetching https://ourbits.club/torrentrss.php?xxxxxxxxxxxxxxxxx {"timestamp":"2019-06-20T12:44:16.920Z"}
info: fetch a round {"timestamp":"2019-06-20T12:44:17.875Z"}

NodeRSSBot/index.js

Lines 240 to 245 in 1cf9a97

let child = process.env.NODE_PRODUTION
? fork(`utils/fetch.js`)
: fork(`utils/fetch.js`, [], {
execArgv: ['--inspect-brk=46209']
});
child.on('message', function(message) {

最近的更改中加入了环境变量判断fork的子进程是否监听debugger的操作。如果不设置的话就会一直等待debugger的连接。所以需要设置NODE_PRODUTION环境变量。现在 start script 会默认加上这个环境变量。你可以直接用 npm start来启动

NodeRSSBot/README.md

Lines 171 to 175 in 1cf9a97

1. 首先要有 Node.js 和 npm 或 yarn
1. 克隆仓库 `git clone https://github.com/fengkx/NodeRSSBot.git`
1. 设置 `RSSBOT_TOKEN` 环境变量,或者直接在 `config/index.js` 中修改
1. 安装依赖 在仓库根目录运行`npm i`
1. 推荐用 `pm2` 守护进程 `pm2 start npm --name node_rssbot -- start` 如果没有安装`pm2` 就先安装 `npm i -g pm2` 或者直接 `npm start`

NodeRSSBot/index.js

Lines 240 to 245 in 1cf9a97

let child = process.env.NODE_PRODUTION
? fork(`utils/fetch.js`)
: fork(`utils/fetch.js`, [], {
execArgv: ['--inspect-brk=46209']
});
child.on('message', function(message) {

最近的更改中加入了环境变量判断fork的子进程是否监听debugger的操作。如果不设置的话就会一直等待debugger的连接。所以需要设置NODE_PRODUTION环境变量。现在 start script 会默认加上这个环境变量。你可以直接用 npm start来启动

NodeRSSBot/README.md

Lines 171 to 175 in 1cf9a97

1. 首先要有 Node.js 和 npm 或 yarn
1. 克隆仓库 `git clone https://github.com/fengkx/NodeRSSBot.git`
1. 设置 `RSSBOT_TOKEN` 环境变量,或者直接在 `config/index.js` 中修改
1. 安装依赖 在仓库根目录运行`npm i`
1. 推荐用 `pm2` 守护进程 `pm2 start npm --name node_rssbot -- start` 如果没有安装`pm2` 就先安装 `npm i -g pm2` 或者直接 `npm start`

谢谢