ruby on rails - Check if external API is online / offline -
i have thoughts how can check if external api available or not.
in controllers, i'm calling api's , don't want call them if not available otherwise thrown error in app.
i think have make job running each x seconds , check if api available or not. if she's not, have variable i'm setting false example.
is best way you?
thanks,
the way describe work of time, there's still window between when api goes down , when job runs controller may try hit api. safer way, , fewer moving parts, catch network exception (etimedout
, etc.) in controller.
Comments
Post a Comment