tasks.py 497 B

1234567891011121314151617
  1. from celery import shared_task
  2. from django.core.management import call_command
  3. from apps.files.tasks import cleanup_old_files
  4. from apps.issue_events.maintenance import cleanup_old_issues
  5. from apps.performance.maintenance import cleanup_old_transaction_events
  6. @shared_task
  7. def perform_maintenance():
  8. """
  9. Update postgres partitions and delete old data
  10. """
  11. call_command("pgpartition", yes=True)
  12. cleanup_old_transaction_events()
  13. cleanup_old_files()
  14. cleanup_old_issues()