[changes] Remove the "worker-ondemand" queue

This commit is contained in:
lanceyq
2026-03-09 14:02:23 +08:00
parent cef14cda9e
commit 476632294f
3 changed files with 4 additions and 16 deletions

View File

@@ -113,7 +113,7 @@ celery_app.conf.update(
'app.tasks.run_forgetting_cycle_task': {'queue': 'periodic_tasks'},
'app.tasks.write_all_workspaces_memory_task': {'queue': 'periodic_tasks'},
'app.tasks.update_implicit_emotions_storage': {'queue': 'periodic_tasks'},
'app.tasks.init_implicit_emotions_for_users': {'queue': 'ondemand_tasks'},
'app.tasks.init_implicit_emotions_for_users': {'queue': 'periodic_tasks'},
},
)

View File

@@ -2457,6 +2457,8 @@ def update_implicit_emotions_storage(self) -> Dict[str, Any]:
acks_late=False,
time_limit=3600,
soft_time_limit=3300,
# 触发型任务标识,区别于 periodic_tasks 队列中的定时任务
triggered=True,
)
def init_implicit_emotions_for_users(self, end_user_ids: List[str]) -> Dict[str, Any]:
"""事件触发任务:对指定用户列表做存在性检查,无记录则执行首次初始化。

View File

@@ -49,7 +49,7 @@ services:
networks:
- celery
# Periodic worker - Scheduled/beat tasks (prefork, low concurrency)
# Periodic worker - Scheduled/beat tasks + API-triggered tasks (prefork, low concurrency)
worker-periodic:
image: redbear-mem-open:latest
container_name: worker-periodic
@@ -63,20 +63,6 @@ services:
networks:
- celery
# On-demand worker - API-triggered tasks (e.g. implicit emotions init)
worker-ondemand:
image: redbear-mem-open:latest
container_name: worker-ondemand
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=4 --queues=ondemand_tasks --max-tasks-per-child=50 -n ondemand_worker@%h
restart: unless-stopped
networks:
- celery
# Celery Beat - scheduler
beat:
image: redbear-mem-open:latest