MCPcopy Create free account
hub / github.com/binkuolo/fastapi / code_cache

Function code_cache

database/redis.py:28–40  ·  view source on GitHub ↗

系统缓存 :return: cache 连接池

()

Source from the content-addressed store, hash-verified

26
27
28async def code_cache() -> Redis:
29 """
30 系统缓存
31 :return: cache 连接池
32 """
33 # 从URL方式创建redis连接池
34 sys_cache_pool = aioredis.ConnectionPool.from_url(
35 f"redis://{os.getenv('CACHE_HOST', '127.0.0.1')}:{os.getenv('CACHE_PORT', 6379)}",
36 db=os.getenv('CACHE_DB', 1),
37 encoding='utf-8',
38 decode_responses=True
39 )
40 return Redis(connection_pool=sys_cache_pool)

Callers 1

app_startFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected