Skip to content

Commit

Permalink
Include date_threshold in log
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush-se committed Nov 21, 2024
1 parent a52053d commit da00d16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/seer/anomaly_detection/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ def toggle_data_purge_flag(alert_id: int):
@sentry_sdk.trace
def cleanup_disabled_alerts():

date_threshold = datetime.now() - timedelta(days=28)

logger.info(
"Cleaning up timeseries data for alerts that have been inactive (detection has not been run) for over 28 days"
f"Cleaning up timeseries data for alerts that have been inactive (detection has not been run) since {date_threshold}"
)

date_threshold = datetime.now() - timedelta(days=28)

with Session() as session:
# Get and delete alerts that haven't been queued for detection in the last 28 days indicating that they are disabled and are safe to cleanup
alerts = (
Expand Down

0 comments on commit da00d16

Please sign in to comment.