maxkb/apps/knowledge/apps.py
朱潮 c4eaeb6499 修复Celery递归调用错误
- 移除Django应用配置中的手动任务注册
- 使用Celery的imports配置确保任务模块被导入
- 避免在ready()方法中访问Celery应用
- 使用Celery的自动发现机制处理任务注册

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 01:33:18 +08:00

13 lines
391 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from django.apps import AppConfig
class KnowledgeConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'knowledge'
def ready(self):
"""在Django应用准备好后确保Celery任务能被发现"""
# 不在这里手动注册任务让Celery的自动发现机制处理
# 这样可以避免递归调用问题
pass