如何解决继续获取TimeoutOverflowWarning数字不适合32位带符号整数超时时间设置为1
我正在使用Snoostorm生成我的reddit收件箱流。我有两个Snoowrap请求者。两者共享相同的clientId,clientSecret,用户名和密码。我不确定双重请求者是否会使程序感到困惑,但是过了一会儿我会收到TimeoutOverflowWarning。
// Configuration File for Snoowrap
// Requiring Snoowrap
const Snoowrap = require('snoowrap');
// Snoowrap Init
const snoowrap = new Snoowrap({
userAgent: process.env.USER_AGENT,clientId: process.env.CLIENT_ID,clientSecret: process.env.CLIENT_SECRET,username: process.env.REDDIT_USER,password: process.env.REDDIT_PASS
});
// Snoowrap Config
snoowrap.config({
requestDelay: 20000,warnings: true,continueAfterRatelimitError: false,retryErrorCodes: [502,504,522],maxRetryAttempts: 3,debug: true
})
module.exports = {
snoowrap: snoowrap,Snoowrap:Snoowrap
}
// Requester file
const snoowrap = require('../config/snoo-config').snoowrap
const Snoowrap = require('../config/snoo-config').Snoowrap
const Snoostorm = require('snoostorm')
const colors = require('colors')
// Need a second client to make requests within the snoostorm,since snoostorm is using the main client to make all the stream requests.
const client = new Snoowrap({
userAgent: 'process.env.USER_AGENT',password: process.env.REDDIT_PASS
})
client.config({
requestDelay: 20000,debug: true
})
const follow_ApproveMeThread = function (masterSubName,secondarySubName) {
const inbox = new Snoostorm.InboxStream(client,{
limit: 5
})
// Get the last 30 comments and a stream of the latest incoming.
inbox.on('item',function (comment) {
if (comment.subreddit_name_prefixed === `r/${masterSubName}`) {
author = comment.author.name
console.log('Adding '.blue + 'u/'.green + author.green + ` as contributor to ${secondarySubName}`.blue)
snoowrap.getSubreddit(secondarySubName).addContributor({
name: author
})
} else {
console.log(('u/' + comment.author.name + ' attempted to request me from an unauthorized subreddit!').red)
}
})
}
然后发生转储:
[debug]从发送到的
get
请求中收到了200个状态代码 https://oauth.reddit.com/message/inbox?raw_json=1&count=9999&limit=5。 ratelimit剩余:568将u / stickRollBot添加为SecondarySub的贡献者
[debug]从发送到的
post
请求中收到了200个状态代码 https://oauth.reddit.com/r/SecondarySub/api/friend?raw_json=1。 ratelimit剩余:567[debug]从发送到的
get
请求中收到了200个状态代码 https://oauth.reddit.com/message/inbox?raw_json=1&count=9999&limit=5。 ratelimit剩余:599[debug]从发送到的
get
请求中收到了200个状态代码 https://oauth.reddit.com/message/inbox?raw_json=1&count=9999&limit=5。 ratelimit剩余:598[debug]从发送到的
get
请求中收到了200个状态代码 https://oauth.reddit.com/message/inbox?raw_json=1&count=9999&limit=5。ratelimitRemaining:597 [debug]从
get
个请求已发送至 https://oauth.reddit.com/message/inbox?raw_json=1&count=9999&limit=5。 ratelimit剩余:596(节点:8728)TimeoutOverflow警告:2147489113不适合 32位有符号整数。超时时间设置为
- (节点:8728)TimeoutOverflowWarning:2147509113不适合32位带符号整数。超时时间设置为1。(节点:8728) TimeoutOverflowWarning:2147529109不适合32位带符号 整数。超时时间设置为1。
整数不断增长,并且应用程序不断发出状态代码为200的成功获取请求,并不断超过速率限制。
解决方法
我想我可能已经解决了,因为自那以后它还没有崩溃,但是我从Snoostorm.InboxStream中删除了limit:5。显然,我不喜欢我像列表一样对待它吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。