This post has been de-listed (Author was flagged for spam)
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hey, very new to using the Reddit API here, and getting a bug I can't quite understand. So my setup is that I have a Discord bot that checks for posts or comments containing X every 15 minutes. The only API calls I make are:
self.reddit.subreddit(sub).new(limit=25)
and
post.comments.replace_more(limit=0)
The main part of the error (it prints a ton of stack trace) is
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='oauth.reddit.com', port=443): Read timed out. (read timeout=16.0)
I thought that it might be the replace_more since I heard it's one request per replacement, but these are small threads, and when I wrapped it in a try/except that's not where the exception was coming from, so it has to be the first.
Now the interesting part is that the first attempt will always succeed. The next will always throw the exception. The next will always succeed, and so on. Even if i retry again 2 seconds after a failure (having just waited a full 15 minutes prior), it will succeed on the second try.
So while it's not really a problem, I'm just wondering if anyone has any insight into why/how this happens. If not, I can just chalk it up to some weirdness of being a component of the bot, even if I don't get it.
Subreddit
Post Details
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/redditdev/c...