feat(celery): add dedicated periodic tasks worker and queue (#261)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user