Fix: Unused HOST and PORT environment variables #1365
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
My computer couldn't connect to the OI server running inside a docker container. This bug comes from this line, originating in commit 24e07c90845ebd1e18c11d4bfeea28f2d201c04f, and has persisted until this PR.
Before the commit linked above, it was possible to change the hostname of the server simply by setting the environment variable
HOST
. When running the OI server from inside a docker container, this env var needs to be set to0.0.0.0
in order for the computer running the docker container to connect to the server. The commit did not remove the code for fetching theHOST
andPORT
env variables, but did stop referring to these variables in favor of hardcoded defaults.Solution
I moved the code for fetching the
HOST
andPORT
env vars into theServer
's constructor.Directions for testing
poetry install -E server
(If you don't have the server dependencies already installed)poetry run pytest tests/core/test_async_core.py
Pre-Submission Checklist (optional but appreciated):
docs/CONTRIBUTING.md
docs/ROADMAP.md
OS Tests (optional but appreciated):