Quickly auto-reload for changes in src/backend/base/langflow modules during development #11259
Ethan16162
started this conversation in
General
Replies: 1 comment
-
|
Quick auto-reload for backend module changes during Langflow dev: Option 1: uvicorn --reload cd src/backend
uvicorn langflow.main:app --reload --reload-dir ./base/langflowOption 2: watchdog script # watch_reload.py
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import subprocess
import time
class ReloadHandler(FileSystemEventHandler):
def on_modified(self, event):
if event.src_path.endswith(".py"):
print(f"Changed: {event.src_path}")
subprocess.run(["pkill", "-f", "langflow"])
subprocess.Popen(["langflow", "run"])
observer = Observer()
observer.schedule(ReloadHandler(), "./base/langflow", recursive=True)
observer.start()Option 3: entr (simple) find src/backend -name "*.py" | entr -r langflow runOption 4: Docker with mounted code volumes:
- ./src/backend:/app/src/backend
environment:
LANGFLOW_AUTO_RELOAD: trueFastest setup: pip install watchdog
LANGFLOW_DEV=true langflow runWe do rapid Langflow development at RevolutionAI. The uvicorn --reload is cleanest for backend changes. What's your dev setup — local or containerized? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using
LFX_DEV=1 make backend/frontendto start the LangFlow project, how can I synchronize changes made undersrc/backend/base/langflowwithout restarting the entire project?When I start the project using the above command, it takes a long time to restart:
Looking forward to your reply.
Beta Was this translation helpful? Give feedback.
All reactions