fix(proxy_server.py): add support for setting master key via .env

This commit is contained in:
Krrish Dholakia 2024-01-03 15:10:25 +05:30
parent ef8f1acfa4
commit 14e501845f
4 changed files with 36 additions and 6 deletions

View file

@ -579,10 +579,11 @@ async def _cache_user_row(user_id: str, cache: DualCache, db: PrismaClient):
response = cache.get_cache(key=cache_key)
if response is None: # Cache miss
user_row = await db.get_data(user_id=user_id)
cache_value = user_row.model_dump_json()
cache.set_cache(
key=cache_key, value=cache_value, ttl=600
) # store for 10 minutes
if user_row is not None:
cache_value = user_row.model_dump_json()
cache.set_cache(
key=cache_key, value=cache_value, ttl=600
) # store for 10 minutes
return