Add improvements
This commit is contained in:
@@ -41,25 +41,21 @@ async def get_onboarding_status(
|
||||
suppliers_url = os.getenv("SUPPLIERS_SERVICE_URL", "http://suppliers-service:8000")
|
||||
recipes_url = os.getenv("RECIPES_SERVICE_URL", "http://recipes-service:8000")
|
||||
|
||||
internal_api_key = settings.INTERNAL_API_KEY
|
||||
|
||||
|
||||
# Fetch counts from all services in parallel
|
||||
async with httpx.AsyncClient(timeout=10.0) as client:
|
||||
results = await asyncio.gather(
|
||||
client.get(
|
||||
f"{inventory_url}/internal/count",
|
||||
params={"tenant_id": tenant_id},
|
||||
headers={"X-Internal-API-Key": internal_api_key}
|
||||
params={"tenant_id": tenant_id}
|
||||
),
|
||||
client.get(
|
||||
f"{suppliers_url}/internal/count",
|
||||
params={"tenant_id": tenant_id},
|
||||
headers={"X-Internal-API-Key": internal_api_key}
|
||||
params={"tenant_id": tenant_id}
|
||||
),
|
||||
client.get(
|
||||
f"{recipes_url}/internal/count",
|
||||
params={"tenant_id": tenant_id},
|
||||
headers={"X-Internal-API-Key": internal_api_key}
|
||||
params={"tenant_id": tenant_id}
|
||||
),
|
||||
return_exceptions=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user