litestar-org / litestar

Production-ready, Light, Flexible and Extensible ASGI API framework | Effortlessly Build Performant APIs
https://litestar.dev/
MIT License
5.66k stars 384 forks source link

Bug: Issue with reload #1191

Closed Alc-Alc closed 1 year ago

Alc-Alc commented 1 year ago

Describe the bug When I start my app using starlite run -r I get the following error

INFO: Will watch for changes in these directories: ['/Users/alc/starlite-apps/starlite_test'] ERROR: [Errno 48] Address already in use

If I stop that and run it without -r it works, so I guess my port is not blocked

To Reproduce Save this as app.py

from starlite import get, Starlite

@get('/')
def route() -> str:
    return 'Hello'

app = Starlite([route])

Additional context @provinzkraut in discord help suggested a workaround using uvicorn <app file>:<application object> --reload and also linked https://github.com/encode/uvicorn/issues/1045

Goldziher commented 1 year ago

ok, assigning this to @provinzkraut for now - he will check it once he feels bette (covid got him).