mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-23 16:10:27 +08:00
update dep docs
This commit is contained in:
@ -45,6 +45,6 @@ RESET_ENVIRON = (
|
||||
SYNC_WORKERS = (
|
||||
"Use gunicorn's blocking 'sync' worker (Unix, --workers > 1) so the kernel "
|
||||
"routes each request to an idle worker instead of queueing it behind an "
|
||||
"in-flight request on a busy async worker. Requires the 'a2wsgi' package. "
|
||||
"Off by default (async worker)."
|
||||
"in-flight request on a busy async worker. Uses the 'a2wsgi' bridge bundled "
|
||||
"with lfx on Unix. Off by default (async worker)."
|
||||
)
|
||||
|
||||
@ -680,12 +680,15 @@ def _launch_workers(
|
||||
from lfx.cli.serve_gunicorn import LFXGunicornApp
|
||||
|
||||
if sync_workers:
|
||||
# Fail fast in the parent rather than per-worker on first request.
|
||||
# Fail fast in the parent rather than per-worker on first request. a2wsgi
|
||||
# ships with lfx on Linux/macOS, so a missing import means a broken
|
||||
# environment, not a forgotten optional install.
|
||||
try:
|
||||
import a2wsgi # noqa: F401
|
||||
except ImportError as exc:
|
||||
typer.echo(
|
||||
"Error: --use-sync-workers requires the 'a2wsgi' package. Install it with: pip install a2wsgi",
|
||||
"Error: --use-sync-workers needs 'a2wsgi', which ships with lfx on Linux/macOS; "
|
||||
"it is missing, so reinstall lfx to restore your environment.",
|
||||
err=True,
|
||||
)
|
||||
raise typer.Exit(1) from exc
|
||||
|
||||
@ -42,7 +42,10 @@ def wsgi_application(environ, start_response):
|
||||
try:
|
||||
from a2wsgi import ASGIMiddleware
|
||||
except ImportError as exc: # pragma: no cover - exercised via --use-sync-workers without the dep
|
||||
msg = "lfx serve --use-sync-workers requires the 'a2wsgi' package. Install it with: pip install a2wsgi"
|
||||
msg = (
|
||||
"lfx serve --use-sync-workers needs 'a2wsgi', which ships with lfx on Linux/macOS; "
|
||||
"it is missing, so reinstall lfx to restore your environment."
|
||||
)
|
||||
raise RuntimeError(msg) from exc
|
||||
_bridge = ASGIMiddleware(app)
|
||||
return _bridge(environ, start_response)
|
||||
|
||||
Reference in New Issue
Block a user