fix: update Makefile to conditionally enable --reload based on worker count (#3675)

* Update Makefile to handle backend port kill errors

* Update Makefile to conditionally enable --reload based on worker count
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-09-03 17:58:35 -03:00 committed by GitHub
commit 6388883f1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -265,16 +265,15 @@ frontendc: install_frontendc
make run_frontend
backend: setup_env install_backend ## run the backend in development mode
@-kill -9 $$(lsof -t -i:7860)
@-kill -9 $$(lsof -t -i:7860) || true
ifdef login
@echo "Running backend autologin is $(login)";
LANGFLOW_AUTO_LOGIN=$(login) poetry run uvicorn \
--factory langflow.main:create_app \
--host 0.0.0.0 \
--port $(port) \
$(if $(workers),,--reload) \
$(if $(filter-out 1,$(workers)),, --reload) \
--env-file $(env) \
--loop asyncio \
$(if $(workers),--workers $(workers),)
@ -284,7 +283,7 @@ else
--factory langflow.main:create_app \
--host 0.0.0.0 \
--port $(port) \
$(if $(workers),,--reload) \
$(if $(filter-out 1,$(workers)),, --reload) \
--env-file $(env) \
--loop asyncio \
$(if $(workers),--workers $(workers),)