tasks.py 431 B

12345678910111213
  1. from celery import shared_task
  2. from django.utils.dateparse import parse_datetime
  3. from glitchtip.debounced_celery_task import debounced_task, debounced_wrap
  4. from .models import EventProjectHourlyStatistic
  5. @debounced_task(lambda x, *a, **k: x)
  6. @shared_task
  7. @debounced_wrap
  8. def update_event_project_hourly_statistic(project_id: int, start_time: str):
  9. EventProjectHourlyStatistic.update(project_id, parse_datetime(start_time))