Skip to content

Commit

Permalink
upd file
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkakkar committed Dec 26, 2024
1 parent 8c18e2e commit 765284b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions posthog/tasks/error_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ def populate_error_tracking_issue_metrics():
last_seen = data.get(b"last_seen")
occurrences = data.get(b"occurrences")

if not last_seen or not occurrences:
# there should be no case where one is missing
try:
client.delete(key)
except Exception as error:
capture_exception(error)
continue

try:
# update the issue and reset redis key
ErrorTrackingIssue.objects.filter(team=team_id, id=issue_id).update(
Expand Down
4 changes: 2 additions & 2 deletions posthog/tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,6 @@ def calculate_external_data_rows_synced() -> None:

@shared_task(ignore_result=True)
def populate_error_tracking_issue_metrics() -> None:
from posthog.tasks.error_tracking import sync_error_tracking_issue_metrics
from posthog.tasks.error_tracking import populate_error_tracking_issue_metrics

sync_error_tracking_issue_metrics()
populate_error_tracking_issue_metrics()

0 comments on commit 765284b

Please sign in to comment.