diff --git a/posthog/tasks/scheduled.py b/posthog/tasks/scheduled.py index 3e302ebe00664..29f08c00756a4 100644 --- a/posthog/tasks/scheduled.py +++ b/posthog/tasks/scheduled.py @@ -223,6 +223,8 @@ def setup_periodic_tasks(sender: Celery, **kwargs: Any) -> None: name="process scheduled changes", ) + add_periodic_task_with_expiry(sender, 3600, invalid_web_replays.s()) + if clear_clickhouse_crontab := get_crontab(settings.CLEAR_CLICKHOUSE_REMOVED_DATA_SCHEDULE_CRON): sender.add_periodic_task( clear_clickhouse_crontab, @@ -314,14 +316,6 @@ def setup_periodic_tasks(sender: Celery, **kwargs: Any) -> None: check_data_import_row_limits.s(), name="check external data rows synced", ) - - add_periodic_task_with_expiry( - sender, - 3600, - invalid_web_replays.s(), - name="Invalid web replays count", - ) - # Every 20 minutes try to retrieve and calculate total rows synced in period sender.add_periodic_task( diff --git a/posthog/tasks/tasks.py b/posthog/tasks/tasks.py index 97c162d1e9fd7..4959344ba5d82 100644 --- a/posthog/tasks/tasks.py +++ b/posthog/tasks/tasks.py @@ -228,8 +228,10 @@ def ingestion_lag() -> None: pass -@shared_task(ignore_result=True) +@shared_task(ignore_result=True, queue=CeleryQueue.SESSION_REPLAY_GENERAL.value) def invalid_web_replays() -> None: + logger.info("[invalid web replays] running task") + from posthog.client import sync_execute # ultimately I want to observe values by team id, but at the moment that would be lots of series, let's reduce the value first diff --git a/posthog/tasks/utils.py b/posthog/tasks/utils.py index 5c8b584b2611d..5e0089bed3c8a 100644 --- a/posthog/tasks/utils.py +++ b/posthog/tasks/utils.py @@ -36,3 +36,4 @@ class CeleryQueue(Enum): USAGE_REPORTS = "usage_reports" SESSION_REPLAY_EMBEDDINGS = "session_replay_embeddings" SESSION_REPLAY_PERSISTENCE = "session_replay_persistence" + SESSION_REPLAY_GENERAL = "session_replay_general"