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

Periodically hard delete Notification records that are older than 90 days. #1320

Closed
rithviknishad opened this issue May 29, 2023 · 3 comments · Fixed by #1328
Closed

Periodically hard delete Notification records that are older than 90 days. #1320

rithviknishad opened this issue May 29, 2023 · 3 comments · Fixed by #1328
Labels
good first issue Good for newcomers

Comments

@rithviknishad
Copy link
Member

Is your feature request related to a problem? Please describe.
The notification table is huge. We don't want notification records older than 90 days.

Describe the solution you'd like
Periodically hard delete records from Notifications table that are older than 90 days.

@rithviknishad rithviknishad added the good first issue Good for newcomers label May 29, 2023
@yaswanthsaivendra
Copy link
Contributor

yaswanthsaivendra commented May 29, 2023

Hey @rithviknishad , i would like to take up this one.

As far i understand, we would need to create a periodic_task using celery that would run maybe every midnight to delete all the notifications that are older than 90 days.

but can we specify a few things for me,

  • Like what would be a great place to create this scheduler function(maybe inside a new file - care/facility/tasks/notification/delete_older_notifications.py)??
  • period/Time to run the task(maybe every midnight)??
  • 90 days later on based upon created_date field??

@rithviknishad
Copy link
Member Author

  1. Yes, that place looks right!
  2. Yes, every midnight should be fine.
  3. Yes, based upon created_date field which is when the notification record has been created.

@rithviknishad
Copy link
Member Author

cc: @yaswanthsaivendra

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

Successfully merging a pull request may close this issue.

2 participants