Hi all, hoping someone can point me in the right direction as I’m struggling to find a solution:
I’m using Airtable Automations + scripts (JavaScript) to grab my latest watched media and send to Trakt via a script (I don’t have Plex Pass otherwise webhooks would solve most of my problem here)
The script checks for updates every hour
However, if/when the server is offline (e.g., my PC is turned off, or my power cuts out), it causes the script to fail, but has no response/error codes; it just times itself out since it can’t reach the “https://ip:port”
Any advice on how I can fail this gracefully?
I’ve tried try…catch blocks or similar and feel like I’m not finding anything to address this very specific thing. I’m also new to networking / scripting, but hoping someone here may have done something like this before. Cheers!
If so, then I can only suggest you change to something else, since that’s a major flaw!
And also wondering, why you are paying for airtable, since it looks like plain free node.js?
And when said, their community could help better, since they know their API, like this post:
Gotcha, yeah, ideally it’d be great if I could bake the timeout into the fetch() request to Plex itself, but other data I’m working with lives in Airtable, and they handle the environment/hosting, so as someone newer to JS it’s convenient
Okay posting here again to see if perhaps there’s another way - anyone found a simple fetch() or other API request to just ping/check if the IP/port is online?