Skip to content

Environment not passed to uvicorn from litestar run #4415

@trhallam

Description

@trhallam

I've run into a bug where the litestar run command does not pass environment variables to Uvicorn under certain conditions. Environment variables are passed when the number of workers > 1 or when using --reload but is ignored otherwise. This prevents the use of Uvicorn env directives (e.g. UVICORN_LOOP=asyncio).

https://github.com/litestar-org/litestar/blob/84cb6d5618abf819ff1b140bbabf3db127241143/litestar/cli/commands/core.py#L274-284

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions