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

Too many checks per minute #12

Closed
Cloudate9 opened this issue Sep 24, 2021 · 2 comments
Closed

Too many checks per minute #12

Cloudate9 opened this issue Sep 24, 2021 · 2 comments

Comments

@Cloudate9
Copy link
Contributor

I have an issue where the program will check too many times a minute, giving an ugly error. Is there a way to prevent this error, rather than just catching it?

(node:57585) UnhandledPromiseRejectionWarning: IgResponseError: GET /api/v1/direct_v2/inbox/?visual_message_return_type=unseen&thread_message_limit=10&persistentBadging=true&limit=20 - 429 Too Many Requests; Please wait a few minutes before you try again.
at Request.handleResponseError (/home/ubuntu/instagram-discord-bridge/node_modules/instagram-private-api/dist/core/request.js:125:16)
at Request.send (/home/ubuntu/instagram-discord-bridge/node_modules/instagram-private-api/dist/core/request.js:53:28)
(node:57585) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: "x")

where "x" is initially 1, which increases by one every time error is thrown.

@Cloudate9
Copy link
Contributor Author

Cloudate9 commented Sep 24, 2021

Messages seem to not link instantly as a result of the this (rate limiting??)

@jake-walker
Copy link
Owner

Yes, this problem is because of rate limiting. Ideally this would be fixed by checking for rate limiting and increasing the interval between checks, although I'm not really supporting this project anymore.

As a quick fix, you could edit the 1 second interval between message checks to something longer in instagram.js:

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