Skip to content

Commit

Permalink
fix(insights): Attribute cache warming queries (#24543)
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie authored Aug 23, 2024
1 parent e0bba1e commit c568328
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion posthog/caching/warming.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def schedule_warming_for_teams_task():
retry_backoff_max=3,
max_retries=3,
)
def warm_insight_cache_task(insight_id: int, dashboard_id: int):
def warm_insight_cache_task(insight_id: int, dashboard_id: Optional[int]):
insight = Insight.objects.get(pk=insight_id)
dashboard = None

Expand All @@ -146,6 +146,8 @@ def warm_insight_cache_task(insight_id: int, dashboard_id: int):
# - in case someone refreshed after this task was triggered
# - if insight + dashboard combinations have the same cache key, we prevent needless recalculations
execution_mode=ExecutionMode.RECENT_CACHE_CALCULATE_BLOCKING_IF_STALE,
insight_id=insight_id,
dashboard_id=dashboard_id,
)

PRIORITY_INSIGHTS_COUNTER.labels(
Expand Down

0 comments on commit c568328

Please sign in to comment.