From 986f474e540669fd9fb72810b3f31fa3f4c3e97a Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Tue, 11 Aug 2020 10:41:27 -0400 Subject: Analytics changes Signed-off-by: Sean Smith Change-Id: Iaea350b3042f9c866939a9d1a79bdef1e165c1a7 Signed-off-by: Sawyer Bergeron --- src/dashboard/tasks.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/dashboard') diff --git a/src/dashboard/tasks.py b/src/dashboard/tasks.py index 50e64c8..8554f6c 100644 --- a/src/dashboard/tasks.py +++ b/src/dashboard/tasks.py @@ -13,7 +13,17 @@ from celery import shared_task from django.utils import timezone from booking.models import Booking from notifier.manager import NotificationHandler -from api.models import Job, JobStatus, SoftwareRelation, HostHardwareRelation, HostNetworkRelation, AccessRelation +from api.models import ( + Job, + JobStatus, + SoftwareRelation, + HostHardwareRelation, + HostNetworkRelation, + AccessRelation, + JobFactory +) + +from resource_inventory.resource_manager import ResourceManager from resource_inventory.models import ConfigState @@ -74,4 +84,10 @@ def free_hosts(): resource__isnull=False ) for booking in bookings: - booking.resource.release() + ResourceManager.getInstance().deleteResourceBundle(booking.resource) + + +@shared_task +def query_vpn_users(): + """ get active vpn users """ + JobFactory.makeActiveUsersTask() -- cgit 1.2.3-korg