fix auto resolve alerts task to get policy checks as well
@@ -293,8 +293,7 @@ def clear_faults_task(older_than_days: int) -> None:
last_seen__lt=djangotime.now() - djangotime.timedelta(days=older_than_days)
)
for agent in agents:
- if agent.agentchecks.exists():
- for check in agent.get_checks_from_policies():
+ for check in agent.get_checks_with_policies():
# reset check status
check.check_result.status = "passing"
check.check_result.save(update_fields=["status"])
