Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /tyvekzhang_fastlib /fastlib /cache /manager.py
| # SPDX-License-Identifier: MIT | |
| """Cache Client manager to instantiate the appropriate cache client""" | |
| from fastlib.config.manager import ConfigManager | |
| async def get_cache_client(): | |
| """Initialize and return the appropriate cache client based on configuration. | |
| Returns: | |
| Cache: Redis client if Redis is enabled in config, otherwise returns FakeRedis client. | |
| """ | |
| config = ConfigManager.get_database_config() | |
| if config.enable_redis: | |
| from fastlib.cache._redis_cache import RedisCacheManager | |
| redis_client = await RedisCacheManager.get_instance() | |
| return redis_client | |
| else: | |
| from fastlib.cache._memony_cache import MemoryCacheManager | |
| fake_client = await MemoryCacheManager.get_instance() | |
| return fake_client | |
Xet Storage Details
- Size:
- 784 Bytes
- Xet hash:
- a49f68c0f8e1c0d02dc5959bf31c9c3d24dbc509d12c42dd0577a3fbdd0e4de3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.