Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Route some trial tasks to different queues #19810

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading