Skip to content

Commit

Permalink
fix: capture no json internal status response
Browse files Browse the repository at this point in the history
Co-authored-by: Nightknight3000 <[email protected]>
  • Loading branch information
antidodo and Nightknight3000 committed Nov 6, 2024
1 parent 682a814 commit df30d57
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/status/status.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
import json
import os
import asyncio
from typing import Literal
Expand Down Expand Up @@ -202,8 +203,12 @@ async def _get_internal_deployment_status(deployment_name: str) -> Literal['fini
response = await AsyncClient(
base_url=f'http://nginx-{deployment_name}:80').get('/analysis/healthz',
headers=[('Connection', 'close')])
print(f"analyse status: {response.json()}")
print(f"response: {response}")
response.raise_for_status()
try:
print(f"analyse status: {response.json()}")
except json.decoder.JSONDecodeError:
print("No JSON in response")
analysis_health_status = response.json()['status']
if analysis_health_status == 'finished':
health_status = 'finished'
Expand Down

0 comments on commit df30d57

Please sign in to comment.