Skip to content

Commit

Permalink
Merge branch 'main' into fix-botocore-error-test
Browse files Browse the repository at this point in the history
  • Loading branch information
umaannamalai authored Sep 17, 2024
2 parents 770bcf4 + d642980 commit 7e19ad8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion newrelic/core/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def environment_settings():
dispatcher.append(("Dispatcher", "gunicorn (gevent)"))
elif "gunicorn.workers.geventlet" in sys.modules:
dispatcher.append(("Dispatcher", "gunicorn (eventlet)"))
elif "uvicorn.workers" in sys.modules:
elif "uvicorn.workers" in sys.modules or "uvicorn_worker" in sys.modules:
dispatcher.append(("Dispatcher", "gunicorn (uvicorn)"))
uvicorn = sys.modules.get("uvicorn")
if hasattr(uvicorn, "__version__"):
Expand Down
11 changes: 11 additions & 0 deletions tests/agent_unittests/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ def test_plugin_list_uses_no_sys_modules_iterator(monkeypatch):
"1.2.3",
"4.5.6",
),
# New replacement module uvicorn_worker should function the same
(
{
"gunicorn": module("1.2.3"),
"uvicorn": module("4.5.6"),
"uvicorn_worker": object(),
},
"gunicorn (uvicorn)",
"1.2.3",
"4.5.6",
),
({"uvicorn": object()}, "uvicorn", None, None),
(
{
Expand Down

0 comments on commit 7e19ad8

Please sign in to comment.