refactor(arq_tasks): log batch order processing start and increase max orders per batch to 100

fix(docker-compose): add restart policy to all services for improved resilience
This commit is contained in:
danial
2025-09-20 00:53:33 +08:00
parent 522b7e7733
commit beaf214057
2 changed files with 8 additions and 2 deletions

View File

@@ -170,7 +170,8 @@ async def batch_process_orders(ctx) -> dict[str, Any]:
Returns:
dict[str, Any]: 批量处理结果
"""
logger.info("开始批量处理订单")
# 检查任务是否暂停
if await redis_manager.is_task_paused():
is_paused, reason = await redis_manager.get_task_pause_state()
@@ -186,7 +187,7 @@ async def batch_process_orders(ctx) -> dict[str, Any]:
links_service = LinksService(session)
processed_count = 0
max_orders_per_batch = 10 # 每批处理的最大订单数
max_orders_per_batch = 100 # 每批处理的最大订单数
while processed_count < max_orders_per_batch:
user_data_id = await redis_manager.get_user_data_id()

View File

@@ -8,6 +8,7 @@ services:
context: ../frontend
dockerfile: Dockerfile
container_name: apple-exchange-frontend
restart: always
ports:
- "3000:8080"
environment:
@@ -30,6 +31,7 @@ services:
context: ../backend
dockerfile: Dockerfile
container_name: apple-exchange-api
restart: always
environment:
- SERVICE_TYPE=api
- ENVIRONMENT=production
@@ -57,6 +59,7 @@ services:
context: ../backend
dockerfile: Dockerfile.worker
container_name: apple-exchange-worker
restart: always
environment:
- SERVICE_TYPE=worker
- ENVIRONMENT=production
@@ -90,6 +93,7 @@ services:
db:
image: postgres:17-alpine
container_name: apple-exchange-db
restart: always
environment:
- POSTGRES_DB=apple_exchange
- POSTGRES_USER=postgres
@@ -110,6 +114,7 @@ services:
redis:
image: redis:7-alpine
container_name: apple-exchange-redis
restart: always
command: ["redis-server", "--requirepass", "Df4jG7zN9pL1tY3"]
volumes:
- redis_data:/data