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

Handle the rate limit exceeding error #71

Closed
wants to merge 4 commits into from

Conversation

MaheraFurniturewala
Copy link
Contributor

@MaheraFurniturewala MaheraFurniturewala commented Mar 18, 2022

Fixes #51

bin/can-merge Outdated
console.error(`API Points: used - ${response.rateLimit.cost}\tremaining - ${response.rateLimit.remaining}`);
}

process.stderr.write(`API Points: used - ${response.rateLimit.cost}\tremaining - ${response.rateLimit.remaining}\n`);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think console.error should remain here; it plays more nicely with the shell output than process.stderr.write

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok! I think I made an error with the closing brackets as well😥

utils/watch.js Outdated
Comment on lines 16 to 18
setTimeout(() => {
process.stderr.write('.');
}, milliSecondsLeft);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this just writes a dot, milliSecondsLeft later. it seems like maybe you want await delay(millisecondsLeft), where delay is async function delay(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); }?

const secondsLeft = Math.ceil(milliSecondsLeft / 1000);

if ((remAPIPoints < lastReqCost) && (retryDelay < milliSecondsLeft)) {
process.stderr.write(`API points exhausted. Command will run after ${secondsLeft} seconds\n\n`);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's going to write a newline, can it use console.error?

@ljharb
Copy link
Owner

ljharb commented Apr 26, 2022

Unfortunately this fork is deleted as well, so this PR is also unrecoverable. the fork was just private; once "allow edits" is re-checked, i can rebase and land this

not sure what happened here

@ljharb ljharb marked this pull request as draft April 26, 2022 04:54
ljharb pushed a commit that referenced this pull request Apr 26, 2022
@ljharb ljharb closed this Apr 26, 2022
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

Successfully merging this pull request may close these issues.

rate limited during --watch
2 participants