feat(celery): add dedicated periodic tasks worker and queue (#261)

This commit is contained in:
Ke Sun
2026-01-30 15:31:48 +08:00
committed by GitHub
parent d9aba92314
commit ccc2009aa8
2 changed files with 20 additions and 5 deletions

View File

@@ -19,6 +19,7 @@ services:
depends_on:
- worker-memory
- worker-document
- worker-periodic
# Memory worker - Memory read/write tasks (threads pool for asyncio)
worker-memory:
@@ -48,6 +49,20 @@ services:
networks:
- celery
# Periodic worker - Scheduled/beat tasks (prefork, low concurrency)
worker-periodic:
image: redbear-mem-open:latest
container_name: worker-periodic
env_file:
- .env
volumes:
- ./files:/files
- /etc/localtime:/etc/localtime:ro
command: celery -A app.celery_worker.celery_app worker -E --loglevel=info --pool=prefork --concurrency=2 --queues=periodic_tasks --max-tasks-per-child=50 -n periodic_worker@%h
restart: unless-stopped
networks:
- celery
# Celery Beat - scheduler
beat:
image: redbear-mem-open:latest