Skip to content

Commit

Permalink
Fix bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed May 22, 2024
1 parent f15ecb9 commit dd9aa72
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions posthog/api/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ def create(self, validated_data: dict[str, Any], **kwargs) -> Team:

return team

def _handle_timezone_update(self, team: Team) -> None:
# TODO: Remove when legacy insight calculation is no more,
# as the HogQL backend's caching always includes timezone in the cache key
def _clear_team_insight_caching_states(self, team: Team) -> None:
# TODO: Remove this method - we should 100% rely on cache keys being different for materially different queries,
# not on remembering to call this method when project settings change. We probably already are in the clear
hashes = InsightCachingState.objects.filter(team=team).values_list("cache_key", flat=True)
cache.delete_many(hashes)

Expand All @@ -350,7 +350,7 @@ def update(self, instance: Team, validated_data: dict[str, Any]) -> Team:
if ("timezone" in validated_data and validated_data["timezone"] != instance.timezone) or (
"modifiers" in validated_data and validated_data["modifiers"] != instance.modifiers
):
self._clear_team_insight_cache(instance)
self._clear_team_insight_caching_states(instance)

if (
"session_replay_config" in validated_data
Expand Down

0 comments on commit dd9aa72

Please sign in to comment.