diff --git a/src/sentry/uptime/consumers/results_consumer.py b/src/sentry/uptime/consumers/results_consumer.py index 0e4fc4b4c1711b..164995724dee6d 100644 --- a/src/sentry/uptime/consumers/results_consumer.py +++ b/src/sentry/uptime/consumers/results_consumer.py @@ -353,16 +353,9 @@ def handle_active_result( **result, }, ) - # TODO(epurkhiser): Dual until we're only reading the uptime_status - # from the uptime_subscription. - now = django_timezone.now() - project_subscription.update( - uptime_status=UptimeStatus.FAILED, - uptime_status_update_date=now, - ) project_subscription.uptime_subscription.update( uptime_status=UptimeStatus.FAILED, - uptime_status_update_date=now, + uptime_status_update_date=django_timezone.now(), ) elif uptime_status == UptimeStatus.FAILED and result_status == CHECKSTATUS_SUCCESS: if not has_reached_status_threshold(project_subscription, result_status, metric_tags): @@ -385,16 +378,9 @@ def handle_active_result( **result, }, ) - # TODO(epurkhiser): Dual until we're only reading the uptime_status - # from the uptime_subscription. - now = django_timezone.now() - project_subscription.update( - uptime_status=UptimeStatus.OK, - uptime_status_update_date=now, - ) project_subscription.uptime_subscription.update( uptime_status=UptimeStatus.OK, - uptime_status_update_date=now, + uptime_status_update_date=django_timezone.now(), ) diff --git a/src/sentry/uptime/subscriptions/subscriptions.py b/src/sentry/uptime/subscriptions/subscriptions.py index 453fba1885da0f..e84961cfde1afa 100644 --- a/src/sentry/uptime/subscriptions/subscriptions.py +++ b/src/sentry/uptime/subscriptions/subscriptions.py @@ -231,7 +231,6 @@ def create_project_uptime_subscription( name=name, owner_user_id=owner_user_id, owner_team_id=owner_team_id, - uptime_status=uptime_status, ) detector = create_detector_from_project_subscription(uptime_monitor) @@ -354,17 +353,11 @@ def disable_uptime_detector(detector: Detector): # Resolve the issue so that we don't see it in the ui anymore resolve_uptime_issue(uptime_monitor) - uptime_monitor.update( - status=ObjectStatus.DISABLED, - # We set the status back to ok here so that if we re-enable we'll start - # from a good state - uptime_status=UptimeStatus.OK, - ) - uptime_subscription.update( - # We set the status back to ok here so that if we re-enable we'll start - # from a good state - uptime_status=UptimeStatus.OK - ) + # We set the status back to ok here so that if we re-enable we'll start + # from a good state + uptime_subscription.update(uptime_status=UptimeStatus.OK) + + uptime_monitor.update(status=ObjectStatus.DISABLED) detector.update(enabled=False) quotas.backend.remove_seat(DataCategory.UPTIME, uptime_monitor)