[changes] Remove the "worker-ondemand" queue
This commit is contained in:
@@ -113,7 +113,7 @@ celery_app.conf.update(
|
|||||||
'app.tasks.run_forgetting_cycle_task': {'queue': 'periodic_tasks'},
|
'app.tasks.run_forgetting_cycle_task': {'queue': 'periodic_tasks'},
|
||||||
'app.tasks.write_all_workspaces_memory_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.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'},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2457,6 +2457,8 @@ def update_implicit_emotions_storage(self) -> Dict[str, Any]:
|
|||||||
acks_late=False,
|
acks_late=False,
|
||||||
time_limit=3600,
|
time_limit=3600,
|
||||||
soft_time_limit=3300,
|
soft_time_limit=3300,
|
||||||
|
# 触发型任务标识,区别于 periodic_tasks 队列中的定时任务
|
||||||
|
triggered=True,
|
||||||
)
|
)
|
||||||
def init_implicit_emotions_for_users(self, end_user_ids: List[str]) -> Dict[str, Any]:
|
def init_implicit_emotions_for_users(self, end_user_ids: List[str]) -> Dict[str, Any]:
|
||||||
"""事件触发任务:对指定用户列表做存在性检查,无记录则执行首次初始化。
|
"""事件触发任务:对指定用户列表做存在性检查,无记录则执行首次初始化。
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- celery
|
- celery
|
||||||
|
|
||||||
# Periodic worker - Scheduled/beat tasks (prefork, low concurrency)
|
# Periodic worker - Scheduled/beat tasks + API-triggered tasks (prefork, low concurrency)
|
||||||
worker-periodic:
|
worker-periodic:
|
||||||
image: redbear-mem-open:latest
|
image: redbear-mem-open:latest
|
||||||
container_name: worker-periodic
|
container_name: worker-periodic
|
||||||
@@ -63,20 +63,6 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- celery
|
- 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
|
# Celery Beat - scheduler
|
||||||
beat:
|
beat:
|
||||||
image: redbear-mem-open:latest
|
image: redbear-mem-open:latest
|
||||||
|
|||||||
Reference in New Issue
Block a user