Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a scheduled cloud task that cleans up expired rows in UserInvite #441

Open
MatoPlus opened this issue Jun 21, 2022 · 1 comment
Open
Assignees

Comments

@MatoPlus
Copy link
Member

MatoPlus commented Jun 21, 2022

This should be a weekly job that checks for any invite that has been more than 2 weeks old, if so remove them.

Similarly, if any invites older than 1 week, remind them to accept the invite.

Technical Notes:

  • For this ticket, create a function to initialize firebase cloud functions
  • Start a fire base cloud function project with firebase init functions
  • Look into creating a cloud function that runs weekly
  • For all user invites that are between 1 <= age <= 2 weeks old, send them an reminder (for now, just print them in the console)
  • For all user invites that are over 2 weeks old, remove them from the database via prisma
  • https://firebase.google.com/docs/functions/schedule-functions
  • good tutorial: https://www.freecodecamp.org/news/how-to-schedule-a-task-with-firebase-cloud-functions/
@MatoPlus MatoPlus assigned MatoPlus and neelismail01 and unassigned MatoPlus Jun 21, 2022
@MatoPlus
Copy link
Member Author

Actually, I think a cleaner solution for deleting expired rows would be using lazy cleanup, whenever we access expired rows, delete them and return error. However, we will still face an issue with reminder emails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants