The json returned from the api has an "expires" property set. It looks like it's usually about 15 seconds after the "last modified" time, and seems to indicate the next time the data is set to update.
It might be worthwhile to wait until the expires time to poll the api again instead of hitting it every 5 seconds, as this could potentially reduce the chance of getting ECONNRESET errors.
At the very least, changing the cron job to every 15 seconds instead of every 5 could help.
The json returned from the api has an "expires" property set. It looks like it's usually about 15 seconds after the "last modified" time, and seems to indicate the next time the data is set to update.
It might be worthwhile to wait until the expires time to poll the api again instead of hitting it every 5 seconds, as this could potentially reduce the chance of getting
ECONNRESET
errors.At the very least, changing the cron job to every 15 seconds instead of every 5 could help.