patch profile

This commit is contained in:
cheykrym 2025-06-29 06:10:06 +03:00
parent 3e3e1f7e7f
commit 66f964678c

View File

@ -25,13 +25,15 @@ async def get_profile_by_user_id(user_id: UUID, token: str) -> dict:
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=f"profile_service unreachable: {str(e)}") raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=f"profile_service unreachable: {str(e)}")
async def get_profiles_by_user_ids(user_ids: List[UUID], token: str) -> Dict[str, dict]: async def get_profiles_by_user_ids(user_ids: List[UUID], token: str, user_agent: str, ip: str) -> Dict[str, dict]:
try: try:
async with httpx.AsyncClient(timeout=5.0, verify=False) as client: async with httpx.AsyncClient(timeout=5.0, verify=False) as client:
response = await client.post( response = await client.post(
f"{settings.PROFILE_SERVICE}/user_ids/internal", f"{settings.PROFILE_SERVICE}/user_ids/internal",
headers={"Authorization": f"Bearer {token}"}, headers={"Authorization": f"Bearer {token}"},
json={"user_ids": user_ids} json={"user_ids": user_ids,
"user_agent": user_agent,
"ip": ip}
) )
if response.status_code != 200: if response.status_code != 200: