do not silently continue on exception
This commit is contained in:
parent
dbd89c72a3
commit
27d537e7bb
|
@ -127,28 +127,18 @@ def cache_db_fields_task() -> None:
|
||||||
|
|
||||||
# sync scheduled tasks
|
# sync scheduled tasks
|
||||||
for task in agent.get_tasks_with_policies(exclude_synced=True):
|
for task in agent.get_tasks_with_policies(exclude_synced=True):
|
||||||
try:
|
if not task.task_result or task.task_result.sync_status == "initial":
|
||||||
if (
|
task.create_task_on_agent(agent=agent if task.policy else None)
|
||||||
not task.task_result
|
elif task.task_result.sync_status == "pendingdeletion":
|
||||||
or task.task_result.sync_status == "initial"
|
task.delete_task_on_agent(agent=agent if task.policy else None)
|
||||||
):
|
elif task.task_result.sync_status == "notsynced":
|
||||||
task.create_task_on_agent(agent=agent if task.policy else None)
|
task.modify_task_on_agent(agent=agent if task.policy else None)
|
||||||
elif task.task_result.sync_status == "pendingdeletion":
|
|
||||||
task.delete_task_on_agent(agent=agent if task.policy else None)
|
|
||||||
elif task.task_result.sync_status == "notsynced":
|
|
||||||
task.modify_task_on_agent(agent=agent if task.policy else None)
|
|
||||||
|
|
||||||
except:
|
|
||||||
continue
|
|
||||||
|
|
||||||
# handles any alerting actions
|
# handles any alerting actions
|
||||||
if Alert.objects.filter(
|
if Alert.objects.filter(
|
||||||
alert_type="availability", agent=agent, resolved=False
|
alert_type="availability", agent=agent, resolved=False
|
||||||
).exists():
|
).exists():
|
||||||
try:
|
Alert.handle_alert_resolve(agent)
|
||||||
Alert.handle_alert_resolve(agent)
|
|
||||||
except:
|
|
||||||
continue
|
|
||||||
|
|
||||||
# update pending patches and pending action counts
|
# update pending patches and pending action counts
|
||||||
agent.pending_actions_count = agent.pendingactions.filter(
|
agent.pending_actions_count = agent.pendingactions.filter(
|
||||||
|
|
Loading…
Reference in New Issue