Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ying Chen committed Feb 7, 2024
1 parent bce09fe commit 9a3aea5
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/promptflow/promptflow/_sdk/_service/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ def get_app(environ, start_response):
return app.wsgi_app(environ, start_response)


# def get_app():
# global app
# if app is None:
# app, _ = create_app()
# return app


def add_start_service_action(subparsers):
"""Add action to start pfs."""
start_pfs_parser = subparsers.add_parser(
Expand Down Expand Up @@ -77,7 +70,7 @@ def start_service(args):
# User Agent will be set based on header in request, so not set globally here.
os.environ[PF_NO_INTERACTIVE_LOGIN] = "true"
port = args.port
get_app()
app, _ = create_app()

def validate_port(port, force_start):
if is_port_in_use(port):
Expand All @@ -95,16 +88,6 @@ def validate_port(port, force_start):
port = get_port_from_config(create_if_not_exists=True)
validate_port(port, args.force)
# Set host to localhost, only allow request from localhost.
# cmd = [
# sys.executable,
# "-m",
# "waitress",
# "--host",
# "127.0.0.1",
# f"--port={port}",
# "--call",
# "promptflow._sdk._service.entry:get_app",
# ]
cmd = ["waitress-serve", f"--listen=127.0.0.1:{port}", "promptflow._sdk._service.entry:get_app"]
if args.synchronous:
subprocess.call(cmd)
Expand Down

0 comments on commit 9a3aea5

Please sign in to comment.