maxime1992 / dev-to-git

Publish a blog post (markdown file) to Dev.to from your command line or from CI with this CLI
MIT License
27 stars 13 forks source link

[Improvement suggestion] - Queue articles publication to meet forem rate limiting #51

Open PChol22 opened 1 year ago

PChol22 commented 1 year ago

Hi!

I am a big fan and user of dev-to-git!

My articles repository contains like 20 articles, and it's starting to hit API rate limits when dev-to-git is publishing everything. I have to restart the job multiple times if I want my new articles to be eventually published.

image

I went through forem's documentation, and it seems like the quotas are:

I think that we could use a small queuing lib designed to stay under the 10calls/30sec rate limit when publishing articles. -> It would not impact people publishing a small amount of articles that much, and would really help big repositories like mine!

I wrote a bit of code that should fix the issue, WDYT? I am open to suggestions and modifications of course.

maxime1992 commented 1 year ago

Hi there, thanks for the kind words an the PR!

That said, I'm in the middle of a complete rewrite :sweat_smile: ! Nothing I wanted to mention before it was done to avoid pressure but I feel like I've got to disclose it now haha.

So I'll put this on hold for now and try to take it into account in the new version directly.

PChol22 commented 1 year ago

Ok it's totally fine for me! Good luck for your rewrite!

maxime1992 commented 1 year ago

I went through forem's documentation, and it seems like the quotas are: 30 calls/30sec for article update 10 calls/30sec for article creation

Where did you find those info? I looked here: https://developers.forem.com/api/v1

But couldn't find it :thinking: