fix auto resolve alerts task to get policy checks as well

This commit is contained in:
sadnub
2022-03-31 12:18:39 -04:00
parent 29774ac014
commit 3c7cf2446e

View File

@@ -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"])