Skip to content

Commit

Permalink
use legacy arg in app.run
Browse files Browse the repository at this point in the history
  • Loading branch information
ancalita committed May 15, 2024
1 parent 158634f commit 29d5272
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions rasa_sdk/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,13 @@ def run(
host = os.environ.get("SANIC_HOST", "0.0.0.0")

logger.info(f"Action endpoint is up and running on {protocol}://{host}:{port}")
app.prepare(
host=host, port=port, ssl=ssl_context, workers=utils.number_of_sanic_workers()
app.run(
host=host,
port=port,
ssl=ssl_context,
workers=utils.number_of_sanic_workers(),
legacy=True,
)
Sanic.serve(primary=app, app_loader=loader)


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions tests/tracing/instrumentation/test_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def test_server_webhook_custom_action_is_instrumented(
app = ep.create_app(action_package)

app.register_listener(
partial(ep.load_tracer_provider, endpoints="endpoints.yml"),
"main_process_start",
partial(ep.load_tracer_provider, "endpoints.yml"),
"before_server_start",
)

_, response = app.test_client.post("/webhook", data=json.dumps(data))
Expand Down

0 comments on commit 29d5272

Please sign in to comment.