Skip to content

Commit

Permalink
chore: cache error tracking query longer
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Jan 15, 2025
1 parent 71454ca commit 3af6d98
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions posthog/hogql_queries/error_tracking_query_runner.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import re
import structlog
from datetime import datetime

from posthog.hogql import ast
from posthog.hogql.constants import LimitContext
from posthog.hogql_queries.utils.query_date_range import QueryDateRange
from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator
from posthog.hogql_queries.query_runner import QueryRunner
from posthog.schema import (
IntervalType,
HogQLFilters,
ErrorTrackingQuery,
ErrorTrackingQueryResponse,
Expand Down Expand Up @@ -228,6 +231,15 @@ def error_tracking_issues(self, ids):
issues = queryset.values("id", "status", "name", "description")
return {item["id"]: item for item in issues}

@cached_property
def query_date_range(self):
return QueryDateRange(
date_range=self.query.dateRange,
team=self.team,
interval=IntervalType.HOUR,
now=datetime.now(),
)


def search_tokenizer(query: str) -> list[str]:
# parse the search query to split it into words, except for quoted strings. Strip quotes from quoted strings.
Expand Down

0 comments on commit 3af6d98

Please sign in to comment.