I need a solution for storing userIds and deleting the data every 24 hours in a Firebase function.
What’s the best practice for this case?
>Solution :
Firebase has a special system for this
Example:
exports.scheduledFunction = functions.pubsub.schedule('every 5 minutes').onRun((context) => {
console.log('This will be run every 5 minutes!');
return null;
});
More info is available at:
https://firebase.blog/posts/2019/04/schedule-cloud-functions-firebase-cron
https://firebase.google.com/docs/functions/schedule-functions