mirror of
https://github.com/docling-project/docling-serve.git
synced 2025-11-29 08:33:50 +00:00
Fix main when workers > 1 (#35)
Always load the app by using an import string Signed-off-by: Guillaume Moutier <3944034+guimou@users.noreply.github.com> Co-authored-by: Guillaume Moutier <3944034+guimou@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
be7e4162af
commit
1bf487b18e
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
|
||||
from docling_serve.app import app
|
||||
from docling_serve.helper_functions import _str_to_bool
|
||||
|
||||
# Launch the FastAPI server
|
||||
@@ -10,8 +9,9 @@ if __name__ == "__main__":
|
||||
port = int(os.getenv("PORT", "5001"))
|
||||
workers = int(os.getenv("UVICORN_WORKERS", "1"))
|
||||
reload = _str_to_bool(os.getenv("RELOAD", "False"))
|
||||
|
||||
run(
|
||||
app,
|
||||
"docling_serve.app:app",
|
||||
host="0.0.0.0",
|
||||
port=port,
|
||||
workers=workers,
|
||||
|
||||
Reference in New Issue
Block a user