fix task call

This commit is contained in:
wh1te909 2022-04-20 00:35:02 +00:00
parent 8eca6c409a
commit 44f9390790
1 changed files with 1 additions and 4 deletions

View File

@ -108,12 +108,9 @@ def server_maintenance(request):
return Response("Nats configuration was reloaded successfully.") return Response("Nats configuration was reloaded successfully.")
if request.data["action"] == "rm_orphaned_tasks": if request.data["action"] == "rm_orphaned_tasks":
from agents.models import Agent
from autotasks.tasks import remove_orphaned_win_tasks from autotasks.tasks import remove_orphaned_win_tasks
for agent in Agent.online_agents(): remove_orphaned_win_tasks.delay()
remove_orphaned_win_tasks.delay(agent.pk)
return Response( return Response(
"The task has been initiated. Check the Debug Log in the UI for progress." "The task has been initiated. Check the Debug Log in the UI for progress."
) )