mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-11-11 17:16:43 -05:00
Chore: cache Github version check for 15 minutes (#11235)
This commit is contained in:
parent
6b55740f56
commit
b9aced07fb
@ -1,3 +1,4 @@
|
|||||||
|
from django.core.cache import cache
|
||||||
from pytest_httpx import HTTPXMock
|
from pytest_httpx import HTTPXMock
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
from rest_framework.test import APIClient
|
from rest_framework.test import APIClient
|
||||||
@ -8,6 +9,9 @@ from paperless import version
|
|||||||
class TestApiRemoteVersion:
|
class TestApiRemoteVersion:
|
||||||
ENDPOINT = "/api/remote_version/"
|
ENDPOINT = "/api/remote_version/"
|
||||||
|
|
||||||
|
def setup_method(self):
|
||||||
|
cache.clear()
|
||||||
|
|
||||||
def test_remote_version_enabled_no_update_prefix(
|
def test_remote_version_enabled_no_update_prefix(
|
||||||
self,
|
self,
|
||||||
rest_api_client: APIClient,
|
rest_api_client: APIClient,
|
||||||
|
|||||||
@ -50,6 +50,7 @@ from django.utils.timezone import make_aware
|
|||||||
from django.utils.translation import get_language
|
from django.utils.translation import get_language
|
||||||
from django.views import View
|
from django.views import View
|
||||||
from django.views.decorators.cache import cache_control
|
from django.views.decorators.cache import cache_control
|
||||||
|
from django.views.decorators.cache import cache_page
|
||||||
from django.views.decorators.http import condition
|
from django.views.decorators.http import condition
|
||||||
from django.views.decorators.http import last_modified
|
from django.views.decorators.http import last_modified
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
@ -2402,6 +2403,7 @@ class UiSettingsView(GenericAPIView):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@method_decorator(cache_page(60 * 15), name="dispatch")
|
||||||
@extend_schema_view(
|
@extend_schema_view(
|
||||||
get=extend_schema(
|
get=extend_schema(
|
||||||
description="Get the current version of the Paperless-NGX server",
|
description="Get the current version of the Paperless-NGX server",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user