Skip to content

Commit

Permalink
Merge pull request #33879 from dimagi/ml/disable-permenant-deletion
Browse files Browse the repository at this point in the history
Disable permenant deletion task
  • Loading branch information
minhaminha committed Dec 14, 2023
2 parents 4fae62e + c5f8918 commit 2e11937
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion corehq/apps/cleanup/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@
logger = logging.getLogger(__name__)


@periodic_task(run_every=crontab(minute=0, hour=0), queue=getattr(settings, 'CELERY_PERIODIC_QUEUE', 'celery'))
# @periodic_task(run_every=crontab(minute=0, hour=0), queue=getattr(settings, 'CELERY_PERIODIC_QUEUE', 'celery'))
def permanently_delete_eligible_data(dry_run=False):
"""
Permanently delete database objects that are eligible for hard deletion.
To be eligible means to have a ``deleted_on`` field with a value less than
the cutoff date returned from ``get_cutoff_date_for_data_deletion``.
:param dry_run: if True, no changes will be committed to the database
"""
"""
NOTE: Do not delete this function! In the interest of keeping deletion records for future reference,
data won't be completely hard deleted until the domain is deleted. Instead, they'll be converted
into a tombstone after the 90 day safety period. This task will be restructured to do that once a day
in a future PR coming soon (Q1 2024).
"""
dry_run_tag = '[DRY RUN] ' if dry_run else ''
cutoff_date = get_cutoff_date_for_data_deletion()
form_counts = XFormInstance.objects.hard_delete_forms_before_cutoff(cutoff_date, dry_run=dry_run)
Expand Down

0 comments on commit 2e11937

Please sign in to comment.