diff --git a/bin/celery-queues.env b/bin/celery-queues.env index 5c9f8c5fde564..de76211d9d5ce 100644 --- a/bin/celery-queues.env +++ b/bin/celery-queues.env @@ -2,4 +2,4 @@ # Important: Add new queues to make Celery consume tasks from them. # NOTE: Keep in sync with posthog/tasks/utils.py -CELERY_WORKER_QUEUES=celery,email,insight_export,insight_refresh,analytics_queries,exports,subscription_delivery \ No newline at end of file +CELERY_WORKER_QUEUES=celery,stats,email,insight_export,insight_refresh,analytics_queries,exports,subscription_delivery \ No newline at end of file diff --git a/posthog/tasks/tasks.py b/posthog/tasks/tasks.py index b1ed342b332e4..49ee706654c49 100644 --- a/posthog/tasks/tasks.py +++ b/posthog/tasks/tasks.py @@ -448,7 +448,7 @@ def clear_clickhouse_deleted_person() -> None: remove_deleted_person_data() -@shared_task(ignore_result=True, queue=CeleryQueue.EMAIL) +@shared_task(ignore_result=True, queue=CeleryQueue.STATS) def redis_celery_queue_depth(): try: with pushed_metrics_registry("redis_celery_queue_depth_registry") as registry: diff --git a/posthog/tasks/utils.py b/posthog/tasks/utils.py index 734c919990d21..19705d454635d 100644 --- a/posthog/tasks/utils.py +++ b/posthog/tasks/utils.py @@ -1,5 +1,3 @@ -from enum import Enum - # NOTE: These are the queues used for logically separating workloads. # Many queues are consumed by one "consumer" - a worker configured to consume from that queue. # The goal should be to split up queues based on the type of work being done, so that we can scale effectively @@ -24,8 +22,9 @@ # NOTE: Keep in sync with bin/celery-queues.env -class CeleryQueue(Enum): +class CeleryQueue: DEFAULT = "celery" + STATS = "stats" EMAIL = "email" INSIGHT_EXPORT = "insight_export" INSIGHT_REFRESH = "insight_refresh"