mirror of
https://github.com/LearningCircuit/local-deep-research.git
synced 2026-06-16 12:02:34 +03:00
* refactor: cleanup remaining verified dead code across 5 areas Dead templates, functions, storage ABCs, eslint duplicate, dev scripts. All verified by 40 agents (20 scanning + 20 verification). * revert: keep 3 dev scripts that have active references - regenerate_golden_master.py: called by pre-commit hook .pre-commit-hooks/check-golden-master-settings.py - restart_server.sh: documented in API testing guide, examples, and multiple README files - run_tests.py: referenced in CONTRIBUTING.md testing section Added inline comments noting the references so future cleanup attempts don't remove them without updating dependents. * revert: keep restart_server_debug.sh dev script * revert: keep debug_pytest.py and stop_server.sh dev scripts Small utility scripts that cost nothing to keep and are useful for developers debugging CI failures and managing the dev server. * docs: add do-not-remove comments to all dev scripts Each script now documents why it must be kept: - regenerate_golden_master.py: pre-commit hook dependency - restart_server.sh: documented in API guides and examples - restart_server_debug.sh: companion to restart_server.sh - run_tests.py: referenced in CONTRIBUTING.md - debug_pytest.py: developer utility for CI failure reproduction - stop_server.sh: companion to restart_server.sh
41 lines
1.5 KiB
Bash
Executable File
41 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# Script to restart the LDR server with DEBUG logging enabled.
|
|
# Do not remove — companion to restart_server.sh for debug workflows.
|
|
#
|
|
# WARNING: Debug logs may contain sensitive data (queries, answers, API responses).
|
|
# This is for local development and feature testing only.
|
|
# Do NOT use in production or with real user data.
|
|
|
|
echo "Stopping existing LDR server..."
|
|
pkill -f "python -m local_deep_research.web.app" 2>/dev/null || echo "No existing server found"
|
|
|
|
# Wait a moment for the process to stop
|
|
sleep 1
|
|
|
|
echo "Starting LDR server in DEBUG mode..."
|
|
# Change to the script's parent directory (project root)
|
|
cd "$(dirname "$0")/../.." || exit 1
|
|
|
|
# Start server in background and detach from terminal
|
|
(nohup env LDR_APP_DEBUG=true LDR_LOG_SETTINGS=summary pdm run python -m local_deep_research.web.app > /tmp/ldr_server.log 2>&1 &) &
|
|
SERVER_PID=$!
|
|
|
|
# Give it a moment to start
|
|
sleep 2
|
|
|
|
echo "Server started. PID: $SERVER_PID"
|
|
echo "Logs: /tmp/ldr_server.log"
|
|
echo "URL: http://127.0.0.1:5000"
|
|
echo ""
|
|
echo "WARNING: Running in DEBUG mode (LDR_APP_DEBUG=true)"
|
|
echo " - Debug logs may contain sensitive data (queries, answers, API responses)"
|
|
echo " - For local development and feature testing only"
|
|
echo " - Do NOT use in production or with real user data"
|
|
echo ""
|
|
echo "To check server status: ps aux | grep 'python -m local_deep_research.web.app'"
|
|
echo "To view logs: tail -f /tmp/ldr_server.log"
|
|
echo "To stop server: pkill -f 'python -m local_deep_research.web.app'"
|
|
|
|
# Exit immediately - don't wait for background process
|
|
exit 0
|