Commit ee0f699e by Karsa Zoltán István

cache for nodesum

parent 66b3e551
...@@ -41,6 +41,9 @@ from rest_framework.permissions import IsAdminUser ...@@ -41,6 +41,9 @@ from rest_framework.permissions import IsAdminUser
from braces.views import LoginRequiredMixin, SuperuserRequiredMixin from braces.views import LoginRequiredMixin, SuperuserRequiredMixin
from django_tables2 import SingleTableView from django_tables2 import SingleTableView
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from firewall.models import Host from firewall.models import Host
from vm.models import Node, NodeActivity, Trait from vm.models import Node, NodeActivity, Trait
from vm.tasks.vm_tasks import check_queue from vm.tasks.vm_tasks import check_queue
...@@ -85,6 +88,7 @@ class GetNodeREST(APIView): ...@@ -85,6 +88,7 @@ class GetNodeREST(APIView):
class GetNodeRESTSum(APIView): class GetNodeRESTSum(APIView):
permission_classes = [] permission_classes = []
@method_decorator(cache_page(60*60*2))
def get(self, request, format=None): def get(self, request, format=None):
nodes = Node.objects.filter(enabled=True, schedule_enabled=True) nodes = Node.objects.filter(enabled=True, schedule_enabled=True)
cpu_core = 0 cpu_core = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment