mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-04 13:59:23 +00:00
Chore: Improve idle memory via more lazy imports (#14599)
* Chore: Import dateparser lazily so processes that never parse dates skip it * Chore: Import turbohtml lazily in the mail parser * Chore: Import lxml lazily in the SVG validator * Chore: Import paperless_ai.indexing lazily in document tasks * Chore: Import paperless_ai helpers lazily in views * Chore: Read the OCRmyPDF sRGB profile on first use instead of at import * Chore: Import pikepdf and img2pdf lazily so startup does not load them * Chore: Reuse the initialized Django ASGI application for HTTP routing
This commit is contained in:
1 parent
a5d3247ca7
commit
6f99ad9469
24 files changed
+110
-73
No files matched your search
@@ -7,8 +7,6 @@ from dataclasses import dataclass
|
||||
from types import TracebackType
|
||||
from typing import Self
|
||||
|
||||
import dateparser
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -80,6 +78,8 @@ class DateParserPluginBase(ABC):
|
||||
|
||||
Uses configuration from `self.config`.
|
||||
"""
|
||||
import dateparser
|
||||
|
||||
try:
|
||||
return dateparser.parse(
|
||||
date_string,
|
||||
|
||||
Reference in new issue
Block a user