Browse Source

ref(crons): Pass reference timestamp down to fan-out tasks (#56985)

We'll need the `ts` to compute check-in date_added's generated in the
tasks more accurately
Evan Purkhiser 1 year ago
parent
commit
a35eeedb24
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/sentry/monitors/tasks.py

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

@@ -1,5 +1,6 @@
 import logging
 from datetime import datetime
+from typing import Optional
 
 import msgpack
 import sentry_sdk
@@ -202,7 +203,7 @@ def check_missing(current_datetime: datetime):
     max_retries=0,
     record_timing=True,
 )
-def mark_environment_missing(monitor_environment_id: int):
+def mark_environment_missing(monitor_environment_id: int, ts: Optional[datetime] = None):
     logger.info("monitor.missed-checkin", extra={"monitor_environment_id": monitor_environment_id})
 
     monitor_environment = MonitorEnvironment.objects.select_related("monitor").get(
@@ -254,7 +255,7 @@ def check_timeout(current_datetime: datetime):
     max_retries=0,
     record_timing=True,
 )
-def mark_checkin_timeout(checkin_id: int):
+def mark_checkin_timeout(checkin_id: int, ts: Optional[datetime] = None):
     logger.info("checkin.timeout", extra={"checkin_id": checkin_id})
 
     checkin = MonitorCheckIn.objects.select_related("monitor_environment").get(id=checkin_id)