Release Beta 5 (#1009)
This commit is contained in:
commit
3604db72f4
5 changed files with 25 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "langflow"
|
name = "langflow"
|
||||||
version = "0.5.0b3"
|
version = "0.5.0b4"
|
||||||
description = "A Python package with a built-in web application"
|
description = "A Python package with a built-in web application"
|
||||||
authors = ["Logspace <contact@logspace.ai>"]
|
authors = ["Logspace <contact@logspace.ai>"]
|
||||||
maintainers = [
|
maintainers = [
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,18 @@ def display_results(results):
|
||||||
console.print() # Print a new line
|
console.print() # Print a new line
|
||||||
|
|
||||||
|
|
||||||
|
def set_var_for_macos_issue():
|
||||||
|
# OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
|
||||||
|
# we need to set this var is we are running on MacOS
|
||||||
|
# otherwise we get an error when running gunicorn
|
||||||
|
|
||||||
|
if platform.system() in ["Darwin"]:
|
||||||
|
import os
|
||||||
|
|
||||||
|
os.environ["OBJC_DISABLE_INITIALIZE_FORK_SAFETY"] = "YES"
|
||||||
|
logger.debug("Set OBJC_DISABLE_INITIALIZE_FORK_SAFETY to YES to avoid error")
|
||||||
|
|
||||||
|
|
||||||
def update_settings(
|
def update_settings(
|
||||||
config: str,
|
config: str,
|
||||||
cache: Optional[str] = None,
|
cache: Optional[str] = None,
|
||||||
|
|
@ -143,7 +155,10 @@ def run(
|
||||||
"""
|
"""
|
||||||
Run the Langflow.
|
Run the Langflow.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
set_var_for_macos_issue()
|
||||||
# override env variables with .env file
|
# override env variables with .env file
|
||||||
|
|
||||||
if env_file:
|
if env_file:
|
||||||
load_dotenv(env_file, override=True)
|
load_dotenv(env_file, override=True)
|
||||||
|
|
||||||
|
|
@ -165,7 +180,6 @@ def run(
|
||||||
options = {
|
options = {
|
||||||
"bind": f"{host}:{port}",
|
"bind": f"{host}:{port}",
|
||||||
"workers": get_number_of_workers(workers),
|
"workers": get_number_of_workers(workers),
|
||||||
"worker_class": "uvicorn.workers.UvicornWorker",
|
|
||||||
"timeout": timeout,
|
"timeout": timeout,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ from gunicorn.app.base import BaseApplication # type: ignore
|
||||||
class LangflowApplication(BaseApplication):
|
class LangflowApplication(BaseApplication):
|
||||||
def __init__(self, app, options=None):
|
def __init__(self, app, options=None):
|
||||||
self.options = options or {}
|
self.options = options or {}
|
||||||
|
|
||||||
|
self.options["worker_class"] = "uvicorn.workers.UvicornWorker"
|
||||||
self.application = app
|
self.application = app
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,10 @@ class ServiceManager:
|
||||||
if service is None:
|
if service is None:
|
||||||
continue
|
continue
|
||||||
logger.debug(f"Teardown service {service.name}")
|
logger.debug(f"Teardown service {service.name}")
|
||||||
service.teardown()
|
try:
|
||||||
|
service.teardown()
|
||||||
|
except Exception as exc:
|
||||||
|
logger.exception(exc)
|
||||||
self.services = {}
|
self.services = {}
|
||||||
self.factories = {}
|
self.factories = {}
|
||||||
self.dependencies = {}
|
self.dependencies = {}
|
||||||
|
|
@ -150,9 +153,3 @@ def initialize_session_service():
|
||||||
dependencies=[ServiceType.CACHE_SERVICE],
|
dependencies=[ServiceType.CACHE_SERVICE],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def teardown_services():
|
|
||||||
"""
|
|
||||||
Teardown all the services.
|
|
||||||
"""
|
|
||||||
service_manager.teardown()
|
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,9 @@ def teardown_services():
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
teardown_superuser(get_settings_service(), next(get_session()))
|
teardown_superuser(get_settings_service(), next(get_session()))
|
||||||
|
except Exception as exc:
|
||||||
|
logger.exception(exc)
|
||||||
|
try:
|
||||||
service_manager.teardown()
|
service_manager.teardown()
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue