Chore: Reduce imports for a slight memory improvement (#9217)

This commit is contained in:
Trenton H
2025-02-24 15:06:14 -08:00
committed by GitHub
parent 3104417076
commit 827fcba277
12 changed files with 71 additions and 26 deletions

View File

@@ -1,9 +1,10 @@
from __future__ import annotations
import logging
from binascii import hexlify
from dataclasses import dataclass
from typing import TYPE_CHECKING
from typing import Final
from typing import Optional
from django.core.cache import cache
@@ -80,7 +81,7 @@ def get_suggestion_cache(document_id: int) -> SuggestionCacheData | None:
def set_suggestions_cache(
document_id: int,
suggestions: dict,
classifier: Optional["DocumentClassifier"],
classifier: DocumentClassifier | None,
*,
timeout=CACHE_50_MINUTES,
) -> None: