tasks.py 637 B

12345678910111213141516171819
  1. from celery import shared_task
  2. from glitchtip.debounced_celery_task import debounced_task, debounced_wrap
  3. from .models import EventProjectHourlyStatistic, TransactionEventProjectHourlyStatistic
  4. @debounced_task(lambda x, *a, **k: x)
  5. @shared_task
  6. @debounced_wrap
  7. def update_event_project_hourly_statistic(project_id: int, start_time: str):
  8. EventProjectHourlyStatistic.update(project_id, start_time)
  9. @debounced_task(lambda x, *a, **k: x)
  10. @shared_task
  11. @debounced_wrap
  12. def update_transaction_event_project_hourly_statistic(project_id: int, start_time: str):
  13. TransactionEventProjectHourlyStatistic.update(project_id, start_time)