修复Celery任务注册问题
- 在tasks/__init__.py中导入media_learning任务 - 在ops/__init__.py中注册media_learning任务到Celery应用 - 修复KeyError: 'media_learning_by_document'错误 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
459b0c8307
commit
638bf0dd1b
@ -3,3 +3,4 @@
|
|||||||
# Import tasks for Celery discovery
|
# Import tasks for Celery discovery
|
||||||
# Note: We import the specific tasks, not * to avoid circular imports
|
# Note: We import the specific tasks, not * to avoid circular imports
|
||||||
from .advanced_learning import advanced_learning_by_document, batch_advanced_learning
|
from .advanced_learning import advanced_learning_by_document, batch_advanced_learning
|
||||||
|
from .media_learning import media_learning_by_document, media_learning_batch
|
||||||
@ -19,3 +19,15 @@ try:
|
|||||||
celery_app.register_task(batch_advanced_learning)
|
celery_app.register_task(batch_advanced_learning)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Import and register media learning tasks
|
||||||
|
try:
|
||||||
|
from knowledge.tasks.media_learning import (
|
||||||
|
media_learning_by_document,
|
||||||
|
media_learning_batch
|
||||||
|
)
|
||||||
|
# Register tasks with the celery app
|
||||||
|
celery_app.register_task(media_learning_by_document)
|
||||||
|
celery_app.register_task(media_learning_batch)
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user