kuhl-haus-mdp-servers 0.1.11__tar.gz → 0.1.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kuhl-haus-mdp-servers
3
- Version: 0.1.11
3
+ Version: 0.1.13
4
4
  Summary: Container image build repository for market data processing servers
5
5
  Author-Email: Tom Pounders <git@oldschool.engineer>
6
6
  License-File: LICENSE.txt
@@ -33,7 +33,7 @@ dependencies = [
33
33
  "python-dotenv",
34
34
  "massive",
35
35
  ]
36
- version = "0.1.11"
36
+ version = "0.1.13"
37
37
 
38
38
  [project.urls]
39
39
  Homepage = "https://github.com/kuhl-haus/kuhl-haus-mdp-servers"
@@ -239,8 +239,10 @@ async def health_check(response: Response):
239
239
  """Health check endpoint"""
240
240
  # The server should be connected to MDQ even when the WebSocket client is not running.
241
241
  status_message = "OK"
242
+ status_code = 1
242
243
  if not massive_data_queues.connection_status["connected"]:
243
244
  status_message = "Unhealthy"
245
+ status_code = 0
244
246
  response.status_code = status.HTTP_503_SERVICE_UNAVAILABLE
245
247
  # TODO: Investigate if this caused health check failures in production during off-hours.
246
248
  # if settings.auto_start and not massive_data_listener.connection_status["connected"]:
@@ -249,6 +251,7 @@ async def health_check(response: Response):
249
251
  return {
250
252
  "service": "Massive Data Listener",
251
253
  "status": status_message,
254
+ "status_code": status_code,
252
255
  "auto-start": settings.auto_start,
253
256
  "container_image": settings.container_image,
254
257
  "image_version": settings.image_version,
@@ -207,6 +207,7 @@ async def health_check(response: Response):
207
207
  try:
208
208
  ret: dict[str, Union[str, dict]] = {
209
209
  "status": "OK",
210
+ "status_code": 1,
210
211
  "container_image": settings.container_image,
211
212
  "image_version": settings.image_version,
212
213
  }
@@ -225,7 +226,7 @@ async def health_check(response: Response):
225
226
  except Exception as e:
226
227
  logger.error(f"Health check error: {e}")
227
228
  response.status_code = status.HTTP_503_SERVICE_UNAVAILABLE
228
- return {"status": "ERROR", "message": "An unhandled exception occurred during health check."}
229
+ return {"status": "ERROR", "status_code": 0, "message": "An unhandled exception occurred during health check."}
229
230
 
230
231
 
231
232
  if __name__ == "__main__":
@@ -89,6 +89,7 @@ async def health_check(response: Response):
89
89
  response.status_code = status.HTTP_200_OK
90
90
  return JSONResponse({
91
91
  "status": "OK",
92
+ "status_code": 1,
92
93
  "container_image": settings.container_image,
93
94
  "image_version": settings.image_version,
94
95
  "active_ws_clients": len(active_ws_clients),
@@ -96,6 +97,7 @@ async def health_check(response: Response):
96
97
  except Exception as e:
97
98
  logger.error(f"Fatal error while processing health check: {e}")
98
99
  response.status_code = status.HTTP_503_SERVICE_UNAVAILABLE
100
+ return {"status": "ERROR", "status_code": 0, "message": "An unhandled exception occurred during health check."}
99
101
 
100
102
 
101
103
  @app.websocket("/ws")