Today I Learned - Rocky Kev

TIL Putting a redundant API key as a backup

POSTED ON:

TAGS:

Have a backup API key in your system. If you get a rate limit error, you can switch over to it.

Great if you're using a free project and need a quick workaround.
But just remember not to abuse resources.

The fatal bug that caused me to take down my bot was that I hit an hourly API rate limit. I took the obvious approach of keeping redundancy in my system: Keep an alternative API key, and once the primary one runs out, switch over to the alternative, and then switch back at the turn of the hour.

Via How to Recover from Deployment Hell – What I Learned After My Discord Bot Crashed on a 1,000+ User Server


Related TILs

Tagged:

TIL Multiple Fetch Requests

I've been frequently dealing with this scenario in the past few weeks. I wanted to make multiple fetch requests, and then merge everything together when it's all done. To make multiple/parallel fetch requests:

TIL how JSON bet on simplicity

I had a goal of being able to put JSON standard on the back of a business card

TIL GraphQL vs Rest