feat: 实现起卦、设置与积分系统
This commit is contained in:
+10
-5
@@ -10,7 +10,7 @@ usage() {
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " start Start local web process in tmux"
|
||||
echo " start Start local web/worker processes in tmux"
|
||||
echo " stop Stop tmux session and orphaned local processes"
|
||||
echo " restart Stop then start all app processes"
|
||||
exit 1
|
||||
@@ -113,7 +113,7 @@ kill_listening_processes() {
|
||||
|
||||
start() {
|
||||
echo "=== Eryao App Up ==="
|
||||
echo "This script starts local web process in tmux."
|
||||
echo "This script starts local web + worker processes in tmux."
|
||||
echo "Redis should be managed separately via docker-compose."
|
||||
echo "NOTE: Database migration must be run separately."
|
||||
echo ""
|
||||
@@ -146,23 +146,27 @@ start() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${ERYAO_DEEPSEEK__API_KEY:-}" ]; then
|
||||
echo "Warning: ERYAO_DEEPSEEK__API_KEY is empty; deepseek calls may fail." >&2
|
||||
if [ -z "${ERYAO_LLM__PROVIDER_KEYS__DEEPSEEK:-}" ]; then
|
||||
echo "Warning: ERYAO_LLM__PROVIDER_KEYS__DEEPSEEK is empty; deepseek calls may fail." >&2
|
||||
fi
|
||||
|
||||
WEB_CMD="cd '$ROOT_DIR' && PYTHONPATH=backend/src ERYAO_RUNTIME__SERVICE_NAME=web uv run uvicorn app:app --host ${ERYAO_WEB__HOST:-0.0.0.0} --port ${WEB_PORT} --workers ${ERYAO_WEB__WORKERS:-2} --log-level ${UVICORN_LOG_LEVEL}"
|
||||
|
||||
WORKER_AGENT_CMD="cd '$ROOT_DIR' && PYTHONPATH=backend/src ERYAO_RUNTIME__SERVICE_NAME=worker-agent uv run taskiq worker core.taskiq.app:worker_agent_broker core.runtime.tasks --workers ${ERYAO_WORKER__GROUPS__AGENT__CONCURRENCY:-2}"
|
||||
WORKER_AGENT_CMD="cd '$ROOT_DIR' && PYTHONPATH=backend/src ERYAO_RUNTIME__SERVICE_NAME=worker-agent uv run taskiq worker core.taskiq.app:worker_agent_broker core.agentscope.runtime.tasks --workers ${ERYAO_WORKER__GROUPS__AGENT__CONCURRENCY:-2}"
|
||||
WORKER_GENERAL_CMD="cd '$ROOT_DIR' && PYTHONPATH=backend/src ERYAO_RUNTIME__SERVICE_NAME=worker-general uv run taskiq worker core.taskiq.app:worker_general_broker core.agentscope.runtime.tasks --workers ${ERYAO_WORKER__GROUPS__GENERAL__CONCURRENCY:-1}"
|
||||
|
||||
echo "Starting tmux web process in session '$SESSION_NAME'..."
|
||||
|
||||
tmux new-session -d -s "$SESSION_NAME" -n web "bash -lc \"$WEB_CMD; echo '[web] exited'; exec bash\""
|
||||
tmux new-window -t "$SESSION_NAME" -n worker-agent "bash -lc \"$WORKER_AGENT_CMD; echo '[worker-agent] exited'; exec bash\""
|
||||
tmux new-window -t "$SESSION_NAME" -n worker-general "bash -lc \"$WORKER_GENERAL_CMD; echo '[worker-general] exited'; exec bash\""
|
||||
|
||||
echo ""
|
||||
echo "=== App Started ==="
|
||||
echo "Log files will be created in logs/ directory:"
|
||||
echo " - web.log, web.error.log"
|
||||
echo " - worker-agent.log, worker-agent.error.log"
|
||||
echo " - worker-general.log, worker-general.error.log"
|
||||
echo ""
|
||||
echo "tmux attach -t $SESSION_NAME"
|
||||
echo "tmux list-windows -t $SESSION_NAME"
|
||||
@@ -184,6 +188,7 @@ stop() {
|
||||
echo "Checking for orphaned processes..."
|
||||
|
||||
kill_matching_processes "uvicorn" "uv run uvicorn app:app"
|
||||
kill_matching_processes "taskiq workers" "uv run taskiq worker core.taskiq.app:"
|
||||
|
||||
kill_listening_processes "port ${WEB_PORT} listeners" "$WEB_PORT"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user