Skip to content

Commit

Permalink
fix: uvicorn host (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurasgkadri98 authored Sep 5, 2024
1 parent f1dbd35 commit d361ada
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/allie/flowkit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ def parse_cli_args():

def substitute_empty_values(args):
"""Substitute the empty values with configuration values."""
host = args.host or urlparse(CONFIG.flowkit_python_endpoint).hostname
port = args.port or urlparse(CONFIG.flowkit_python_endpoint).port
CONFIG.flowkit_python_endpoint = f"http://{host}:{port}"
CONFIG.flowkit_python_endpoint = f"http://0.0.0.0:{port}"
CONFIG.flowkit_python_workers = args.workers or CONFIG.flowkit_python_workers
CONFIG.use_ssl = (args.use_ssl.lower() == "true") if args.use_ssl is not None else CONFIG.use_ssl
CONFIG.ssl_cert_private_key_file = args.ssl_keyfile or CONFIG.ssl_cert_private_key_file
Expand All @@ -64,13 +63,12 @@ def main():
# Substitute the empty values with configuration values
substitute_empty_values(args)

host = urlparse(CONFIG.flowkit_python_endpoint).hostname
port = urlparse(CONFIG.flowkit_python_endpoint).port

# Run the service
uvicorn.run(
"allie.flowkit.flowkit_service:flowkit_service",
host=host,
host="0.0.0.0",
port=port,
workers=CONFIG.flowkit_python_workers,
ssl_keyfile=CONFIG.ssl_cert_private_key_file if CONFIG.use_ssl else None,
Expand Down

0 comments on commit d361ada

Please sign in to comment.