Browse Source

fix(crons): Simplify update call on task (#52294)

Simplifies DB call to mark check-in as timed_out
Richard Ortenberg 1 year ago
parent
commit
267174a8b3
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/sentry/monitors/tasks.py

+ 1 - 3
src/sentry/monitors/tasks.py

@@ -114,9 +114,7 @@ def check_monitors(current_datetime=None):
                 "monitor_environment.checkin-timeout",
                 extra={"monitor_environment_id": monitor_environment.id, "checkin_id": checkin.id},
             )
-            affected = MonitorCheckIn.objects.filter(
-                id=checkin.id, status=CheckInStatus.IN_PROGRESS
-            ).update(status=CheckInStatus.TIMEOUT)
+            affected = checkin.update(status=CheckInStatus.TIMEOUT)
             if not affected:
                 continue