fix(forge): cast port to int (#6643)

When executing `port = os.getenv("PORT", 8000)` if the port is being fetched from a `.env` file it is fetched as a string.

This caused an error: `TypeError: 'str' object cannot be interpreted as an integer`
This commit is contained in:
Or Arbel
2024-01-12 12:24:40 +02:00
committed by GitHub
parent 25cc6ad6ae
commit 48a2186cf3

View File

@@ -41,5 +41,5 @@ if __name__ == "__main__":
forge.sdk.forge_log.setup_logger()
uvicorn.run(
"forge.app:app", host="localhost", port=port, log_level="error", reload=True
"forge.app:app", host="localhost", port=int(port), log_level="error", reload=True
)