celery worker在windows上启动失败,增加参数--pool=solo

This commit is contained in:
mark.tian
2025-12-08 15:16:17 +08:00
parent f9c74a1dda
commit 5cf3b008d3
3 changed files with 6 additions and 95 deletions

View File

@@ -31,7 +31,7 @@ celery_app.conf.update(
beat_schedule={
'push-data-to-dtc-every-minute': {
'task': 'push_data_to_dtc',
'schedule': 120.0, # 每60秒执行一次(1分钟)
'schedule': 60.0, # 每60秒执行一次(1分钟)
},
},
)

View File

@@ -33,7 +33,7 @@ def push_data_to_dtc_task(self):
"""
task_name = 'push_data_to_dtc'
logger.info(f"🌿 开始推送数据给DTC任务")
# 获取分布式锁,使用任务名称作为锁标识
lock = redis_manager.create_lock(f"celery_task:{task_name}", timeout=300) # 5分钟超时