feat: optimize code
This commit is contained in:
@@ -11,6 +11,7 @@ def add_redis_route(app: FastAPI):
|
||||
|
||||
@app.get("/redis_get/{key}")
|
||||
async def redis_get(key: str, redis_client: RedisClientDep):
|
||||
exists = bool(await redis_client.exists(key))
|
||||
# exists = bool(await redis_client.exists(key))
|
||||
mapping = await redis_client.hgetall(key)
|
||||
exists = bool(mapping)
|
||||
return {"result": {"exists": exists, "mapping": mapping}}
|
||||
|
||||
Reference in New Issue
Block a user