Fix LangflowApplication initialization
This commit is contained in:
parent
66ebaa80eb
commit
6b5d51016a
2 changed files with 3 additions and 4 deletions
|
|
@ -305,7 +305,7 @@ def run_langflow(host, port, log_level, options, app):
|
||||||
else:
|
else:
|
||||||
from langflow.server import LangflowApplication
|
from langflow.server import LangflowApplication
|
||||||
|
|
||||||
LangflowApplication(options).run()
|
LangflowApplication(app, options).run()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
logger.info("Shutting down server")
|
logger.info("Shutting down server")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,11 @@ from gunicorn.app.base import BaseApplication # type: ignore
|
||||||
|
|
||||||
|
|
||||||
class LangflowApplication(BaseApplication):
|
class LangflowApplication(BaseApplication):
|
||||||
def __init__(self, options=None):
|
def __init__(self, app, options=None):
|
||||||
self.options = options or {}
|
self.options = options or {}
|
||||||
from langflow.main import create_app
|
|
||||||
|
|
||||||
self.options["worker_class"] = "uvicorn.workers.UvicornWorker"
|
self.options["worker_class"] = "uvicorn.workers.UvicornWorker"
|
||||||
self.application = create_app()
|
self.application = app
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def load_config(self):
|
def load_config(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue