mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-13 17:19:56 +08:00
fix(backend): use background task for startup to avoid blocking server
Change program.startup() to run via asyncio.create_task() so uvicorn accepts connections immediately while downloader check runs in background. Also add .claude/ project settings. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
87
.claude/settings.local.json
Normal file
87
.claude/settings.local.json
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(git -C /Users/estrella/Developer/AutoBangumi/Auto_Bangumi log --oneline -10)",
|
||||
"Bash(git checkout:*)",
|
||||
"Bash(python -m pytest:*)",
|
||||
"Bash(python:*)",
|
||||
"Bash(uv init:*)",
|
||||
"Bash(uv sync:*)",
|
||||
"Bash(uv run pytest:*)",
|
||||
"Skill(feature-dev:feature-dev)",
|
||||
"Bash(uv pip install:*)",
|
||||
"Bash(uv run python:*)",
|
||||
"Bash(curl:*)",
|
||||
"Bash(pkill:*)",
|
||||
"Bash(uv pip show:*)",
|
||||
"Bash(uv pip list:*)",
|
||||
"Bash(uv lock:*)",
|
||||
"Bash(lsof:*)",
|
||||
"Bash(kill:*)",
|
||||
"Bash(VITE_API_URL=http://localhost:18080 pnpm dev:*)",
|
||||
"Bash(pnpm dev:*)",
|
||||
"Bash(pnpm add:*)",
|
||||
"Bash(git add:*)",
|
||||
"Bash(git commit:*)",
|
||||
"Skill(planning-with-files)",
|
||||
"Bash(../.venv/bin/python -m pytest test/test_database.py -v)",
|
||||
"Bash(.venv/bin/python:*)",
|
||||
"Bash(ruff check:*)",
|
||||
"Bash(ls:*)",
|
||||
"Bash(/Users/estrella/Developer/AutoBangumi/Auto_Bangumi/backend/.venv/bin/python:*)",
|
||||
"Bash(uv run ruff check:*)",
|
||||
"Bash(git rm:*)",
|
||||
"Bash(git push:*)",
|
||||
"Bash(gh pr create:*)",
|
||||
"Bash(gh pr checks:*)",
|
||||
"Bash(gh run view:*)",
|
||||
"Bash(git ls-tree:*)",
|
||||
"Bash(while read f)",
|
||||
"Bash(do git show \"HEAD:$f\")",
|
||||
"Bash(done)",
|
||||
"Bash(git reset:*)",
|
||||
"Skill(ui-ux-pro-max)",
|
||||
"Bash(tree:*)",
|
||||
"Bash(git stash:*)",
|
||||
"Bash(python3:*)",
|
||||
"Bash(pnpm build:*)",
|
||||
"Bash(pnpm install:*)",
|
||||
"Bash(uv venv:*)",
|
||||
"Bash(../.venv/bin/python:*)",
|
||||
"Bash(xargs:*)",
|
||||
"Skill(agent-browser)",
|
||||
"Bash(agent-browser open:*)",
|
||||
"Bash(agent-browser screenshot:*)",
|
||||
"Bash(agent-browser snapshot:*)",
|
||||
"Bash(agent-browser eval \"JSON.stringify\\(window.__consoleErrors || ''no errors captured''\\)\")",
|
||||
"Bash(agent-browser eval:*)",
|
||||
"Bash(agent-browser close:*)",
|
||||
"Bash(agent-browser reload:*)",
|
||||
"Bash(agent-browser fill:*)",
|
||||
"Bash(agent-browser click:*)",
|
||||
"Skill(commit-commands:commit)",
|
||||
"Bash(gh api:*)",
|
||||
"Bash(git fetch:*)",
|
||||
"Bash(git rebase:*)",
|
||||
"Bash(grep:*)",
|
||||
"Bash(git merge:*)",
|
||||
"Bash(agent-browser scroll:*)",
|
||||
"Bash(agent-browser find text \"Passkey Settings\" click)",
|
||||
"Bash(agent-browser find:*)",
|
||||
"Bash(agent-browser find text \"添加\" click)",
|
||||
"Bash(npx vue-tsc:*)",
|
||||
"Bash(npx vite build:*)",
|
||||
"WebSearch",
|
||||
"WebFetch(domain:bangumi.github.io)",
|
||||
"WebFetch(domain:raw.githubusercontent.com)",
|
||||
"WebFetch(domain:api.bgm.tv)",
|
||||
"Bash(__NEW_LINE_e2219f405dac932c__ echo \"\")",
|
||||
"Bash(__NEW_LINE_7c1bb4605ef4ad2a__ echo \"\")",
|
||||
"Bash(source ../.venv/bin/activate)",
|
||||
"Bash(source:*)",
|
||||
"Bash(npx vite:*)",
|
||||
"Bash(agent-browser press:*)",
|
||||
"Bash(agent-browser get:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
import signal
|
||||
@@ -19,7 +20,7 @@ router = APIRouter(tags=["program"])
|
||||
|
||||
@router.on_event("startup")
|
||||
async def startup():
|
||||
await program.startup()
|
||||
asyncio.create_task(program.startup())
|
||||
|
||||
|
||||
@router.on_event("shutdown")
|
||||
|
||||
Reference in New Issue
Block a user