feat: Customize DB path for JCloud app

This commit is contained in:
Zac Li 2023-07-06 16:57:20 +08:00
commit 6eea2d8d58

View file

@ -1,5 +1,13 @@
# This file is used by lc-serve to load the mounted app and serve it.
import os
# Use the JCLOUD_WORKSPACE for db URL if it's provided by JCloud.
if 'JCLOUD_WORKSPACE' in os.environ:
os.environ[
'LANGFLOW_DATABASE_URL'
] = f"sqlite:///{os.environ['JCLOUD_WORKSPACE']}/langflow.db"
from langflow.main import setup_app
from langflow.utils.logger import configure