feat: Customize DB path for JCloud app (#619)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-06 10:31:25 -03:00 committed by GitHub
commit c038247dcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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