Skip to content

Commit

Permalink
feat: Route some trial tasks to different queues (#19810)
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie authored Jan 17, 2024
1 parent 8c4b1d2 commit 5254cc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/celery-queues.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Default set of queues to be used by Celery.
# Important: Add new queues to make Celery consume tasks from them.
CELERY_WORKER_QUEUES=celery,email,insight_export,insight_refresh,gevent
CELERY_WORKER_QUEUES=celery,email,insight_export,insight_refresh,analytics_queries
6 changes: 3 additions & 3 deletions posthog/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ def redis_heartbeat():
get_client().set("POSTHOG_HEARTBEAT", int(time.time()))


@app.task(ignore_result=True, bind=True)
def process_query_task(self, team_id, query_id, query_json, limit_context=None, refresh_requested=False):
@app.task(ignore_result=True, queue="analytics_queries")
def process_query_task(team_id, query_id, query_json, limit_context=None, refresh_requested=False):
"""
Kick off query
Once complete save results to redis
Expand Down Expand Up @@ -822,7 +822,7 @@ def clear_clickhouse_deleted_person():
remove_deleted_person_data()


@app.task(ignore_result=True)
@app.task(ignore_result=True, queue="email")
def redis_celery_queue_depth():
try:
with pushed_metrics_registry("redis_celery_queue_depth_registry") as registry:
Expand Down

0 comments on commit 5254cc7

Please sign in to comment.