diff --git a/README.md b/README.md index bd4a4ad..2f87b02 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,16 @@ Open the WebUI in a browser after launch only when explicitly requested: GOVOPLAN_OPEN_BROWSER=1 ./tools/launch/launch-dev.sh ``` +Limit backend reload triggers during focused module work without changing the +enabled module graph: + +```sh +GOVOPLAN_BACKEND_RELOAD_MODULES=calendar,campaign ./tools/launch/launch-dev.sh +``` + +Set `GOVOPLAN_BACKEND_RELOAD_MODULES=none` to watch only core/config sources. +Leaving it unset keeps the broad default and watches all enabled modules. + Start the shared development PostgreSQL service: ```sh diff --git a/tools/launch/launch-dev.sh b/tools/launch/launch-dev.sh index 735a4f0..e51f2cb 100644 --- a/tools/launch/launch-dev.sh +++ b/tools/launch/launch-dev.sh @@ -22,6 +22,7 @@ FRONTEND_USE_POLLING="${GOVOPLAN_FRONTEND_USE_POLLING:-1}" FRONTEND_POLLING_INTERVAL="${GOVOPLAN_FRONTEND_POLLING_INTERVAL:-500}" AUTO_SYNC_PYTHON="${GOVOPLAN_AUTO_SYNC_PYTHON:-1}" DEV_DATABASE_BACKEND="${GOVOPLAN_DEV_DATABASE_BACKEND:-postgres}" +BACKEND_RELOAD_MODULES="${GOVOPLAN_BACKEND_RELOAD_MODULES:-}" LOG_DIR="${GOVOPLAN_DEV_LOG_DIR:-$META_ROOT/runtime/dev-launcher}" BACKEND_LOG="$LOG_DIR/backend.log" @@ -167,7 +168,16 @@ port_is_free "$BACKEND_HOST" "$BACKEND_PORT" || fail "$BACKEND_URL is already in port_is_free "$FRONTEND_HOST" "$FRONTEND_PORT" || fail "$FRONTEND_URL is already in use" printf 'Starting GovOPlaN backend at %s\n' "$BACKEND_URL" -run_grouped "$ROOT" "$BACKEND_LOG" "$PYTHON" -m govoplan_core.devserver --host "$BACKEND_HOST" --port "$BACKEND_PORT" +backend_args=(-m govoplan_core.devserver --host "$BACKEND_HOST" --port "$BACKEND_PORT") +if [ "$BACKEND_RELOAD_MODULES" = "none" ]; then + backend_args+=(--reload-core-only) +elif [ -n "$BACKEND_RELOAD_MODULES" ]; then + IFS=',' read -r -a reload_modules <<< "$BACKEND_RELOAD_MODULES" + for reload_module in "${reload_modules[@]}"; do + [ -n "$reload_module" ] && backend_args+=(--reload-module "$reload_module") + done +fi +run_grouped "$ROOT" "$BACKEND_LOG" "$PYTHON" "${backend_args[@]}" backend_pid="$run_grouped_pid" printf 'Waiting for %s/health\n' "$BACKEND_URL"