Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
cache: Used lru_cache from functools instead of django.utils.lru_cache.
arpit551af3a34fbcacb
diff --git a/zerver/lib/cache.py b/zerver/lib/cache.pyindex 204f4788bf5..c95473134d5 100644--- a/zerver/lib/cache.py+++ b/zerver/lib/cache.py@@ -8,7 +8,7 @@ import reimport sysimport timeimport traceback-from functools import wraps+from functools import lru_cache, wrapsfrom typing import (TYPE_CHECKING,Any,@@ -29,7 +29,6 @@ from django.core.cache import cachesfrom django.core.cache.backends.base import BaseCachefrom django.db.models import Qfrom django.http import HttpRequest-from django.utils.lru_cache import lru_cachefrom zerver.lib.utils import make_safe_digest, statsd, statsd_key@@ -669,7 +668,9 @@ def ignore_unhashable_lru_cache(maxsize: int=128, typed: bool=False) -> DECORATO# In the development environment, we want every file# change to refresh the source files from disk.return user_function- cache_enabled_user_function = internal_decorator(user_function)++ # Casting to Any since we're about to monkey-patch this.+ cache_enabled_user_function = cast(Any, internal_decorator(user_function))def wrapper(*args: Any, **kwargs: Any) -> Any:if not hasattr(cache_enabled_user_function, 'key_prefix'):diff --git a/zerver/lib/i18n.py b/zerver/lib/i18n.pyindex 66c4bae2727..9c6d33c0a15 100644--- a/zerver/lib/i18n.py+++ b/zerver/lib/i18n.py@@ -1,13 +1,13 @@import loggingimport operatorimport os+from functools import lru_cachefrom itertools import zip_longestfrom typing import Any, Dict, Listimport orjsonfrom django.conf import settingsfrom django.utils import translation-from django.utils.lru_cache import lru_cachefrom django.utils.translation import ugettext as _