Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config is not getting set with Snoostorm #7

Closed
Ishneetkaur opened this issue May 25, 2018 · 2 comments
Closed

Config is not getting set with Snoostorm #7

Ishneetkaur opened this issue May 25, 2018 · 2 comments

Comments

@Ishneetkaur
Copy link

Using the following code

const r = new Snoowrap({
    userAgent: USER_AGENT,
    clientId: CLIENT_ID,
    clientSecret: CLIENT_SECRET,
    username: USERNAME,
    password: PASSWORD
});

r.config({continueAfterRatelimitError: true});

const client = new Snoostorm(r);
stream = client.SubmissionStream({
     subreddit: subreddits,
      results: 10,
      pollTime: 1000
});
stream.on('submission', (data) => {
 // data has continueAfterRatelimitError as false.
});

I am getting the following:

You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
Error: snoowrap refused to continue because reddit's ratelimit was exceeded. For more information about reddit's ratelimit, please consult reddit's API rules at https://github.com/reddit/reddit/wiki/API.
@brenapp
Copy link
Owner

brenapp commented May 26, 2018

Don't think this is an issue with snoostorm. Whenever the module is passed a Snoowrap object, it just uses it verbatim:

return class SnooStorm {
    constructor(client) {
        this.client = isClass(client) ? client : new snoowrap(client);
    }
   // ...
}

The pollTime defaults are set so an application can use both streams and never run into ratelimit problems. In most instances, the only variable you'll need to mess with is results:, just based on the size of the subreddit.

@brenapp
Copy link
Owner

brenapp commented May 30, 2018

I'm gonna go ahead and close this issue.

This error you're experiencing is related to your use of continueAfterRatelimitError property (of course), but by default, snoowrap will wait to comply with rate limits. If you have questions about that, I think you may find better luck filing an issue on not-an-aardvark/snoowrap

Sorry if you're having trouble, and thanks for using snoostorm!

@brenapp brenapp closed this as completed May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants