fix task call
This commit is contained in:
parent
8eca6c409a
commit
44f9390790
|
@ -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."
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue