-
In the new process manager mode, if I pass in the wrong app, the process keeps restarting. After I read the @Kludex What do you think? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If you can show me some code, it would be nice. |
Beta Was this translation helpful? Give feedback.
-
# uvicorn_test.py
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
if __name__ == '__main__':
import uvicorn
uvicorn.run("uvicorn_test:app2", host="0.0.0.0", port=8000, workers=3) In multiprocess mode this will result in constant reboots because sys.exit occurs in a child process. https://github.com/encode/uvicorn/blob/master/uvicorn/config.py#L435-L439 So if we put the loading app in the main process, this will be solved. #2444 |
Beta Was this translation helpful? Give feedback.
If you can show me some code, it would be nice.