-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
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`); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
setTimeout(() => { | ||
process.stderr.write('.'); | ||
}, milliSecondsLeft); |
There was a problem hiding this comment.
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)); }
?
c202359
to
b32601c
Compare
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`); |
There was a problem hiding this comment.
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
?
not sure what happened here |
Fixes #51