devto-cli icon indicating copy to clipboard operation
devto-cli copied to clipboard

Update failed: HTTPError: Response code 429 (Too Many Requests)

Open bcouetil opened this issue 2 years ago • 4 comments

Hello, many thanks for this wonderful tool 🥰

I have this error when I push multiple (at least 5) articles at once :

Update failed: HTTPError: Response code 429 (Too Many Requests)

So when I update a minor thing in every articles, I fall back to this :

for file in *.md; do sleep 2 && dev push $file; done

Would it be possible to limit requests to dev.to ?

bcouetil avatar Aug 15 '23 18:08 bcouetil

Did you try dev push *.md instead of calling dev push multiple times?

jikuja avatar Oct 21 '23 17:10 jikuja

Thank you for your time 😊

When I say "at once", I mean what you suggested. The loop is a workaround.

bcouetil avatar Oct 21 '23 17:10 bcouetil

Looks like I cannot read and/or understand.

I could not reproduce it with three updates. As soon as I have more articles to update I'll return to this unless it has been already fixed before that. Looks like three updates was not high enough to trigger throttling.

The code already has support for throttling:

https://github.com/sinedied/devto-cli/blob/main/src/api.ts#L11-L14 & https://github.com/sinedied/devto-cli/blob/main/src/api.ts#L76C55-L76C55 but it is turned on only for new article creation. It should be fairly easy to add similar throttling for updates but sane values are needed for that.

jikuja avatar Oct 21 '23 18:10 jikuja

Great, thank you for the analysis, it makes sense : I have mostly existing articles, 10 of them in the same folder 👍

My workaround is satisfying for now.

bcouetil avatar Oct 21 '23 18:10 bcouetil

Fixed by #36

sinedied avatar Jul 18 '24 09:07 sinedied

You rock man, thanks 🫡

bcouetil avatar Jul 18 '24 22:07 bcouetil