根因:多图生成走一条 HTTP 串行出 N 张,4 张累计 >120s 被 gunicorn 强杀 worker → 500 (日志实锤 SystemExit on ARK response.begin)。采纳用户建议拆成「每张一条请求」: - App.tsx generateImages: 拆成 N 条并行单张请求(Promise.allSettled),单张约 30s 不超时, 并行后总耗时≈单张(比串行快 N 倍),任一张失败只丢那张(各自独立扣费/回滚) - Dockerfile: gunicorn --timeout 120→300,给慢 ARK 留余量(双保险) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
AirShelf Backend
All backend code lives under AirShelf/core/backend by project decision.
Local bootstrap
cd /Users/maidong/Desktop/zyc/qiyuan_gitea/AirShelf/core/backend
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
Start workers in separate terminals:
cd /Users/maidong/Desktop/zyc/qiyuan_gitea/AirShelf/core/backend
source .venv/bin/activate
celery -A airshelf worker -l info
ffmpeg must be available on PATH for Stage5 export jobs.
Runtime layout
- Django project:
airshelf - Domain apps:
apps/* - Settings module:
airshelf.settings.development - Celery app:
airshelf.celery
Secrets must be supplied by environment variables or .env; never commit values from account.md.
Useful commands
python manage.py check
python manage.py makemigrations --check --dry-run
python manage.py migrate
python manage.py bootstrap_volcano_models
python manage.py test apps.accounts apps.projects apps.billing