Changed default cache TTL to 0 and None for memcached and redis respectively
All checks were successful
Analysis / SonarCloud (push) Successful in 50s
Analysis / SonarCloud (pull_request) Successful in 52s
Tests / Build and Test (3.11) (pull_request) Successful in 1m14s
Tests / Build and Test (3.12) (pull_request) Successful in 1m20s
Tests / Build and Test (3.13) (pull_request) Successful in 1m18s

This commit is contained in:
2025-07-08 00:01:14 +02:00
parent 32a9e14d0c
commit e4ce5976f2
2 changed files with 2 additions and 10 deletions

View File

@@ -7,8 +7,6 @@ from pymemcache import Client
from .cache import Cache
from ..utils._objects import _json_to_string, _string_to_json
DEFAULT_TTS_SECONDS: int = 300
logger: Logger = logging.getLogger(__name__)
@@ -20,9 +18,7 @@ class CacheMemcached(Cache):
) -> None:
self.client: Client = client
self.prefix: str | None = prefix
self.default_ttl_seconds: int = (
default_ttl_seconds if default_ttl_seconds is not None else DEFAULT_TTS_SECONDS
)
self.default_ttl_seconds: int = default_ttl_seconds if default_ttl_seconds is not None else 0
logger.info("Initialized Memcached for caching")

View File

@@ -7,8 +7,6 @@ from redis import Redis
from .cache import Cache
from ..utils._objects import _json_to_string, _string_to_json
DEFAULT_TTS_SECONDS: int = 300
logger: Logger = logging.getLogger(__name__)
@@ -20,9 +18,7 @@ class CacheRedis(Cache):
) -> None:
self.client: Redis = client
self.prefix: str | None = prefix
self.default_ttl_seconds: int = (
default_ttl_seconds if default_ttl_seconds is not None else DEFAULT_TTS_SECONDS
)
self.default_ttl_seconds: int | None = default_ttl_seconds
logger.info("Initialized Redis for caching")