tasks.py 514 B

1234567891011121314151617
  1. from celery import shared_task
  2. from glitchtip.debounced_celery_task import debounced_task, debounced_wrap
  3. from .models import Project, TransactionEventProjectHourlyStatistic
  4. @debounced_task(lambda x, *a, **k: x)
  5. @shared_task
  6. @debounced_wrap
  7. def update_transaction_event_project_hourly_statistic(project_id: int, start_time: str):
  8. TransactionEventProjectHourlyStatistic.update(project_id, start_time)
  9. @shared_task
  10. def delete_project(project_id: int):
  11. Project.objects.get(id=project_id).force_delete()