Skip to content

Commit

Permalink
Final formatting fix and adding logging on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelltaylor committed Apr 11, 2024
1 parent b1d2294 commit a228c77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions florist/api/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""FLorist client FastAPI endpoints."""
import json
import logging
import uuid
from pathlib import Path

Expand All @@ -17,6 +18,9 @@
app = FastAPI()


LOGGER = logging.getLogger("uvicorn.error")


@app.get("/api/client/connect")
def connect() -> JSONResponse:
"""
Expand Down Expand Up @@ -96,4 +100,5 @@ def check_status(client_uuid: str, redis_host: str, redis_port: str) -> JSONResp
return JSONResponse({"error": f"Client {client_uuid} Not Found"}, status_code=404)

except Exception as ex:
LOGGER.exception(ex)
return JSONResponse({"error": str(ex)}, status_code=500)
2 changes: 1 addition & 1 deletion florist/tests/integration/api/test_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_train():
client_uuid = response.json()["client_uuids"][0]

# Wait for training to finish
wait_for_metric(server_uuid, "fit_end", test_redis_host,test_redis_port, LOGGER, max_retries=80)
wait_for_metric(server_uuid, "fit_end", test_redis_host, test_redis_port, LOGGER, max_retries=80)

# Check server metrics
server_metrics_result = redis_conn.get(server_uuid)
Expand Down

0 comments on commit a228c77

Please sign in to comment.