Skip to content

Commit

Permalink
catch kill error
Browse files Browse the repository at this point in the history
  • Loading branch information
thatstoasty committed Jan 12, 2025
1 parent ef0569e commit 8914f99
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion lightbug_http/server.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ struct Server(Movable):
if close_connection:
response.set_connection_close()

logger.debug(request.method, request.uri.path, response.status_code)
logger.debug(
conn.socket._remote_address.ip,
str(conn.socket._remote_address.port),
request.method,
request.uri.path,
response.status_code,
)
try:
_ = conn.write(encode(response^))
except e:
Expand Down
4 changes: 2 additions & 2 deletions scripts/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test_server() {
magic run python3 tests/integration/integration_client.py

rm ./integration_test_server
kill_server "integration_test_server"
kill_server "integration_test_server" || echo "Failed to kill Mojo server"
}

test_client() {
Expand All @@ -32,7 +32,7 @@ test_client() {

./integration_test_client
rm ./integration_test_client
kill_server "fastapi run"
kill_server "fastapi run" || echo "Failed to kill fastapi server"
}

test_server
Expand Down

0 comments on commit 8914f99

Please sign in to comment.