Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(experiments): register the recalculation precompute worker queue (#126567)

Rodrigo Iloro6af834eb3682
diff --git a/posthog/management/commands/start_temporal_worker.py b/posthog/management/commands/start_temporal_worker.py
index 50ead805045e..ee8cc1f6eaaa 100644
--- a/posthog/management/commands/start_temporal_worker.py
+++ b/posthog/management/commands/start_temporal_worker.py
@@ -502,6 +502,11 @@ _task_queue_specs = [
[],
EXPERIMENT_RECALCULATION_ACTIVITY_QUEUE_ACTIVITIES,
),
+ (
+ settings.EXPERIMENTS_RECALCULATION_PRECOMPUTE_TASK_QUEUE,
+ [],
+ EXPERIMENT_RECALCULATION_ACTIVITY_QUEUE_ACTIVITIES,
+ ),
(
settings.HEALTH_CHECK_TASK_QUEUE,
HEALTH_CHECK_WORKFLOWS,
diff --git a/posthog/settings/temporal.py b/posthog/settings/temporal.py
index 028213a845a8..20c977279126 100644
--- a/posthog/settings/temporal.py
+++ b/posthog/settings/temporal.py
@@ -376,6 +376,9 @@ EXPERIMENTS_RECALCULATION_TASK_QUEUE = _set_temporal_task_queue("experiments-rec
EXPERIMENTS_RECALCULATION_ACTIVITY_TASK_QUEUE = _set_temporal_task_queue(
"experiments-recalculation-activity-task-queue"
)
+EXPERIMENTS_RECALCULATION_PRECOMPUTE_TASK_QUEUE = _set_temporal_task_queue(
+ "experiments-recalculation-precompute-task-queue"
+)
HEALTH_CHECK_TASK_QUEUE = _set_temporal_task_queue("health-check-task-queue")
DUCKLAKE_TASK_QUEUE = _set_temporal_task_queue("ducklake-task-queue")
TASKS_TASK_QUEUE = _set_temporal_task_queue("tasks-task-queue")
diff --git a/products/experiments/backend/temporal/test_registration.py b/products/experiments/backend/temporal/test_registration.py
index 97baff2ee891..b28911bf3366 100644
--- a/products/experiments/backend/temporal/test_registration.py
+++ b/products/experiments/backend/temporal/test_registration.py
@@ -95,5 +95,5 @@ def test_calc_activity_registered_on_recalculation_and_activity_queues():
]
assert len(recalculation_specs) == 1
assert calculate_experiment_metric_for_recalculation in recalculation_specs[0]
- assert activity_queue_specs == [([], EXPERIMENT_RECALCULATION_ACTIVITY_QUEUE_ACTIVITIES)]
+ assert activity_queue_specs == [([], EXPERIMENT_RECALCULATION_ACTIVITY_QUEUE_ACTIVITIES)] * 2
assert EXPERIMENT_RECALCULATION_ACTIVITY_QUEUE_ACTIVITIES == [calculate_experiment_metric_for_recalculation]