]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Merge caching
authorshamoon <4887959+shamoon@users.noreply.github.com>
Tue, 8 Apr 2025 23:36:31 +0000 (16:36 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Tue, 8 Apr 2025 23:36:31 +0000 (16:36 -0700)
src/documents/signals/handlers.py
src/documents/tasks.py
src/documents/tests/test_api_documents.py
src/paperless/caching.py [moved from src/documents/caching.py with 100% similarity]
src/paperless/classifier.py
src/paperless/conditionals.py
src/paperless/views.py

index 98ef65978057cce8960b336b690ef8924778c1c4..85058ad051101f508c7373049b02033a2aa4b234 100644 (file)
@@ -23,10 +23,10 @@ from django.utils import timezone
 from filelock import FileLock
 from guardian.shortcuts import remove_perm
 
-from documents.caching import clear_document_caches
 from documents.mail import send_email
 from documents.templating.workflows import parse_w_workflow_placeholders
 from paperless import matching
+from paperless.caching import clear_document_caches
 from paperless.file_handling import create_source_path_directory
 from paperless.file_handling import delete_empty_directories
 from paperless.file_handling import generate_unique_filename
index f4af14aa66a7c13bdb119691cd1cf93529911cad..482c1d443a871e8ec7983da6e516950747085145 100644 (file)
@@ -20,7 +20,6 @@ from filelock import FileLock
 from whoosh.writing import AsyncWriter
 
 from documents import sanity_checker
-from documents.caching import clear_document_caches
 from documents.plugins.base import ConsumeTaskPlugin
 from documents.plugins.base import ProgressManager
 from documents.plugins.base import StopConsumeTaskError
@@ -31,6 +30,7 @@ from documents.signals.handlers import cleanup_document_deletion
 from documents.signals.handlers import run_workflows
 from paperless import index
 from paperless.barcodes import BarcodePlugin
+from paperless.caching import clear_document_caches
 from paperless.classifier import DocumentClassifier
 from paperless.classifier import load_classifier
 from paperless.consumer import ConsumerPlugin
index 34f5abc9c246376d2cce8d6965462c93244ce7ba..2033e61f8e53e9525fc87f9699a651f62a76b0ef 100644 (file)
@@ -24,13 +24,13 @@ from guardian.shortcuts import assign_perm
 from rest_framework import status
 from rest_framework.test import APITestCase
 
-from documents.caching import CACHE_50_MINUTES
-from documents.caching import CLASSIFIER_HASH_KEY
-from documents.caching import CLASSIFIER_MODIFIED_KEY
-from documents.caching import CLASSIFIER_VERSION_KEY
 from documents.signals.handlers import run_workflows
 from documents.tests.utils import DirectoriesMixin
 from documents.tests.utils import DocumentConsumeDelayMixin
+from paperless.caching import CACHE_50_MINUTES
+from paperless.caching import CLASSIFIER_HASH_KEY
+from paperless.caching import CLASSIFIER_MODIFIED_KEY
+from paperless.caching import CLASSIFIER_VERSION_KEY
 from paperless.data_models import DocumentSource
 from paperless.models import Correspondent
 from paperless.models import CustomField
index 042cba1a5f24bafcdc96fd9b9f3cca28722e6eee..f794db7a16a503bceb1bf47b55d102515e8064c8 100644 (file)
@@ -17,10 +17,10 @@ if TYPE_CHECKING:
 from django.conf import settings
 from django.core.cache import cache
 
-from documents.caching import CACHE_50_MINUTES
-from documents.caching import CLASSIFIER_HASH_KEY
-from documents.caching import CLASSIFIER_MODIFIED_KEY
-from documents.caching import CLASSIFIER_VERSION_KEY
+from paperless.caching import CACHE_50_MINUTES
+from paperless.caching import CLASSIFIER_HASH_KEY
+from paperless.caching import CLASSIFIER_MODIFIED_KEY
+from paperless.caching import CLASSIFIER_VERSION_KEY
 from paperless.models import Document
 from paperless.models import MatchingModel
 
index 8686888d142783376f5bfb27ca9870c2f0a0dddb..ed33a28649191bc74283850b4741e4ea53338cc5 100644 (file)
@@ -4,12 +4,12 @@ from datetime import timezone
 from django.conf import settings
 from django.core.cache import cache
 
-from documents.caching import CACHE_5_MINUTES
-from documents.caching import CACHE_50_MINUTES
-from documents.caching import CLASSIFIER_HASH_KEY
-from documents.caching import CLASSIFIER_MODIFIED_KEY
-from documents.caching import CLASSIFIER_VERSION_KEY
-from documents.caching import get_thumbnail_modified_key
+from paperless.caching import CACHE_5_MINUTES
+from paperless.caching import CACHE_50_MINUTES
+from paperless.caching import CLASSIFIER_HASH_KEY
+from paperless.caching import CLASSIFIER_MODIFIED_KEY
+from paperless.caching import CLASSIFIER_VERSION_KEY
+from paperless.caching import get_thumbnail_modified_key
 from paperless.classifier import DocumentClassifier
 from paperless.models import Document
 
index 8dd5141058410abddf51a510993184e7e51e6225..9fcd2dd59966364d86c0e4290deb12f6a49004d0 100644 (file)
@@ -89,12 +89,6 @@ from rest_framework.viewsets import ModelViewSet
 from rest_framework.viewsets import ReadOnlyModelViewSet
 from rest_framework.viewsets import ViewSet
 
-from documents.caching import get_metadata_cache
-from documents.caching import get_suggestion_cache
-from documents.caching import refresh_metadata_cache
-from documents.caching import refresh_suggestions_cache
-from documents.caching import set_metadata_cache
-from documents.caching import set_suggestions_cache
 from documents.filters import CorrespondentFilterSet
 from documents.filters import CustomFieldFilterSet
 from documents.filters import DocumentFilterSet
@@ -121,6 +115,12 @@ from paperless import version
 from paperless.bulk_download import ArchiveOnlyStrategy
 from paperless.bulk_download import OriginalAndArchiveStrategy
 from paperless.bulk_download import OriginalsOnlyStrategy
+from paperless.caching import get_metadata_cache
+from paperless.caching import get_suggestion_cache
+from paperless.caching import refresh_metadata_cache
+from paperless.caching import refresh_suggestions_cache
+from paperless.caching import set_metadata_cache
+from paperless.caching import set_suggestions_cache
 from paperless.celery import app as celery_app
 from paperless.classifier import load_classifier
 from paperless.conditionals import metadata_etag