diff --git a/api/tacticalrmm/winupdate/tasks.py b/api/tacticalrmm/winupdate/tasks.py index 0381b89e..487b171e 100644 --- a/api/tacticalrmm/winupdate/tasks.py +++ b/api/tacticalrmm/winupdate/tasks.py @@ -1,11 +1,15 @@ +from time import sleep + from agents.models import Agent from .models import WinUpdate - from tacticalrmm.celery import app @app.task -def check_for_updates_task(pk): +def check_for_updates_task(pk, wait=False): + + if wait: + sleep(60) agent = Agent.objects.get(pk=pk) diff --git a/api/tacticalrmm/winupdate/views.py b/api/tacticalrmm/winupdate/views.py index 32206813..64d0461c 100644 --- a/api/tacticalrmm/winupdate/views.py +++ b/api/tacticalrmm/winupdate/views.py @@ -25,7 +25,7 @@ def get_win_updates(request, pk): @api_view() def run_update_scan(request, pk): agent = get_object_or_404(Agent, pk=pk) - check_for_updates_task.delay(agent.pk) + check_for_updates_task.delay(agent.pk, wait=False) return Response("ok")