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?