sinedied / devto-cli

Dev.to authoring CLI to create and publish markdown files as articles, using assets hosted on GitHub.
MIT License
33 stars 3 forks source link

Add Retry + delay on HTTP 429 #36

Closed Ryrden closed 3 months ago

Ryrden commented 3 months ago

Hi, as discussed at issue https://github.com/sinedied/publish-devto/issues/37 I've implemented a Retry + delay for update/create articles here.

As the code already has pThrottle, I reused it too to limit the number of requests to 30 every 30 seconds as said on dev.to docs.

Now the code uses pThrottle both to Create and to Update the Article and if the request fails a retry with a max quantity of 3 retries each 1 second of delay is applied.

Could you please review @sinedied? If needed, mention the issue here about 429 too.

github-actions[bot] commented 3 months ago

:tada: This PR is included in version 1.4.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: