diff --git a/api/djangormm/api/views.py b/api/djangormm/api/views.py index 4bad0792..fe39daaa 100644 --- a/api/djangormm/api/views.py +++ b/api/djangormm/api/views.py @@ -38,7 +38,9 @@ from checks.models import ( MemoryHistory, CpuHistory, ) +from winupdate.models import WinUpdate from agents.tasks import uninstall_agent_task, sync_salt_modules_task +from winupdate.tasks import check_for_updates_task from agents.serializers import AgentHostnameSerializer logger.configure(**settings.LOG_CONFIG) @@ -303,6 +305,11 @@ def update(request): sync_salt_modules_task.delay(agent.pk) + # check for updates if this is fresh agent install + if not WinUpdate.objects.filter(agent=agent).exists(): + check_for_updates_task.delay(agent.pk) + + return Response("ok") diff --git a/install.sh b/install.sh index 0bbd49f1..c6e02986 100755 --- a/install.sh +++ b/install.sh @@ -649,7 +649,7 @@ server { location / { root /var/www/rmm/dist; try_files \$uri \$uri/ /index.html; - add_header Cache-Control "no-store, no-cache, must-revalidate"; + add_header Cache-Control "no-store, no-cache, must-revalidate"; add_header Pragma "no-cache"; } error_log /var/log/nginx/frontend-error.log;