I'm making simple mobile app using react-native. it's server check some http resource every minute. If the changes exist, it send push notifications to user.
In this situation, can I use Google Cloud Functions (Cloud Functions for Firebase) as a server?
I searched some cloud function example but they usually are kinds of event listener, http request or background change event.
Can I use cloud functions for those cron jobs?
exports.checkNewData = function(url){
var latestData = db.get.latestData;
request.get(url, function(res, body){
if(body != latestData) sendPush('There is a new data')...
})
}
If can, How do I execute that function every minute?
Is it okay to just wrapping setInterval
the inside of function?