mirror of
https://git.oceanpay.cc/danial/kami_apple_exchage.git
synced 2025-12-18 22:29:09 +00:00
本次提交将后端的任务队列系统从Celery迁移到了Arq,以支持基于协程的任务处理。主要改动包括: - 更新文档和配置文件,反映架构变化。 - 修改健康检查和服务初始化逻辑,以适应Arq的使用。 - 移除与Celery相关的代码,并添加Arq任务定义和调度器。 - 更新Dockerfile和相关脚本,确保Arq worker能够正确运行。 - 调整API和业务服务中的任务处理逻辑,移除对Celery的依赖。 这些改动旨在提高系统的异步处理能力和整体性能。
73 lines
1.6 KiB
Makefile
73 lines
1.6 KiB
Makefile
.PHONY: help install dev test lint format clean build run docker-build docker-run arq-worker
|
|
|
|
# Default target
|
|
help:
|
|
@echo "Available commands:"
|
|
@echo " install - Install dependencies"
|
|
@echo " dev - Install development dependencies"
|
|
@echo " test - Run tests"
|
|
@echo " lint - Run linting"
|
|
@echo " format - Format code"
|
|
@echo " clean - Clean build artifacts"
|
|
@echo " build - Build the application"
|
|
@echo " run - Run the application"
|
|
@echo " docker-build - Build Docker image"
|
|
@echo " docker-run - Run Docker container"
|
|
@echo " arq-worker - Run Arq worker with coroutine pool"
|
|
|
|
# Install dependencies
|
|
install:
|
|
uv sync
|
|
|
|
# Install development dependencies
|
|
dev:
|
|
uv sync --dev
|
|
uv run pre-commit install
|
|
|
|
# Run tests
|
|
test:
|
|
uv run pytest
|
|
|
|
# Run linting
|
|
lint:
|
|
uv run flake8 app/
|
|
uv run mypy app/
|
|
uv run bandit -r app/
|
|
|
|
# Format code
|
|
format:
|
|
uv run black app/
|
|
uv run isort app/
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
find . -type d -name "__pycache__" -exec rm -rf {} +
|
|
find . -type f -name "*.pyc" -delete
|
|
find . -type f -name "*.pyo" -delete
|
|
find . -type d -name "*.egg-info" -exec rm -rf {} +
|
|
rm -rf build/
|
|
rm -rf dist/
|
|
rm -rf .pytest_cache/
|
|
rm -rf .mypy_cache/
|
|
rm -rf htmlcov/
|
|
|
|
# Build the application
|
|
build:
|
|
uv build
|
|
|
|
# Run the application
|
|
run:
|
|
uv run python run.py
|
|
|
|
# Build Docker image
|
|
docker-build:
|
|
docker build -t kami-apple-exchange-backend .
|
|
|
|
# Run Docker container
|
|
docker-run:
|
|
docker run -p 8000:8000 --env-file .env kami-apple-exchange-backend
|
|
|
|
# Run Arq worker with coroutine pool support
|
|
arq-worker:
|
|
uv run python scripts/start_arq_worker.py
|