I am trying to run a cron job with Firebase. Basically I need to run a function that makes a ton of API calls and pushes data to firebase at 12:00am PST every day. Is there
If you don't want to use a free online HTTP trigger/request generator (e.g. https://atrigger.com/), one approach is to fire the cloud function upon user (client-side) interaction with your app. A stored number
type field could hold a UNIX timestamp. If that timestamp is greater than 24 hours old, continue to fire your server-side cloud function (and refresh timestamp) else stop/break/quit. Could be a week or month or whatever time interval you want.
What if no user interacts with your app? In that case, why update your app's data? Regarding stale data for the 1st user, that's a matter of tuning your time interval. Also, you could possible alert the user that new data is being fetched and to hold on/wait.