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
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:
6
src/libbot/cache/classes/cache_memcached.py
vendored
6
src/libbot/cache/classes/cache_memcached.py
vendored
@@ -7,8 +7,6 @@ from pymemcache import Client
|
|||||||
from .cache import Cache
|
from .cache import Cache
|
||||||
from ..utils._objects import _json_to_string, _string_to_json
|
from ..utils._objects import _json_to_string, _string_to_json
|
||||||
|
|
||||||
DEFAULT_TTS_SECONDS: int = 300
|
|
||||||
|
|
||||||
logger: Logger = logging.getLogger(__name__)
|
logger: Logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@@ -20,9 +18,7 @@ class CacheMemcached(Cache):
|
|||||||
) -> None:
|
) -> None:
|
||||||
self.client: Client = client
|
self.client: Client = client
|
||||||
self.prefix: str | None = prefix
|
self.prefix: str | None = prefix
|
||||||
self.default_ttl_seconds: int = (
|
self.default_ttl_seconds: int = default_ttl_seconds if default_ttl_seconds is not None else 0
|
||||||
default_ttl_seconds if default_ttl_seconds is not None else DEFAULT_TTS_SECONDS
|
|
||||||
)
|
|
||||||
|
|
||||||
logger.info("Initialized Memcached for caching")
|
logger.info("Initialized Memcached for caching")
|
||||||
|
|
||||||
|
6
src/libbot/cache/classes/cache_redis.py
vendored
6
src/libbot/cache/classes/cache_redis.py
vendored
@@ -7,8 +7,6 @@ from redis import Redis
|
|||||||
from .cache import Cache
|
from .cache import Cache
|
||||||
from ..utils._objects import _json_to_string, _string_to_json
|
from ..utils._objects import _json_to_string, _string_to_json
|
||||||
|
|
||||||
DEFAULT_TTS_SECONDS: int = 300
|
|
||||||
|
|
||||||
logger: Logger = logging.getLogger(__name__)
|
logger: Logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@@ -20,9 +18,7 @@ class CacheRedis(Cache):
|
|||||||
) -> None:
|
) -> None:
|
||||||
self.client: Redis = client
|
self.client: Redis = client
|
||||||
self.prefix: str | None = prefix
|
self.prefix: str | None = prefix
|
||||||
self.default_ttl_seconds: int = (
|
self.default_ttl_seconds: int | None = default_ttl_seconds
|
||||||
default_ttl_seconds if default_ttl_seconds is not None else DEFAULT_TTS_SECONDS
|
|
||||||
)
|
|
||||||
|
|
||||||
logger.info("Initialized Redis for caching")
|
logger.info("Initialized Redis for caching")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user