Reputation: 1135
I have created a firebase presence system as shown in the Build Presence in Firebase doc. Now I am trying to clean up some user data after the user has been offline for 15 minutes or more, but I'm not entirely sure how to create this function to run after 15 minutes of inactivity.
I was thinking about using a cronjob, but I didn't want to continuously run the function. Just when the user goes offline for more than 15 minutes. The other thing is that if the user logs back in before the 15 minutes are up, the function would be canceled. Any thoughts?
Upvotes: 0
Views: 557
Reputation: 317322
Cloud Functions currently doesn't provide any sort of scheduling mechanism. This includes cron jobs that run repeatedly any sort of one-time jobs to be scheduled on a delay. You will have to find a way to implement this yourself with the help of some other backend you control, such as an App Engine Task Queue.
Upvotes: 1