Skip to content

Feat/2.3.0 beta1#1796

Merged
zgqgit merged 9 commits intoreleasefrom
feat/2.3.0-beta1
Nov 28, 2025
Merged

Feat/2.3.0 beta1#1796
zgqgit merged 9 commits intoreleasefrom
feat/2.3.0-beta1

Conversation

@zgqgit
Copy link
Copy Markdown
Collaborator

@zgqgit zgqgit commented Nov 28, 2025

No description provided.

ieayoio and others added 9 commits November 27, 2025 15:32
Avoid writing 'from bisheng. worker import bisheng_celery' that depends on submodules
我发现worker的task中存在比较多如下写法:
```python
from bisheng.worker import bisheng_celery
```
目前这种写法依赖task中存在`from bisheng.worker.main import
bisheng_celery`的写法,而`bisheng/worker/__init__.py`中将所有task注册导致目前的写法正常。


目前,如果我将`bisheng/worker/test/test.py`和`bisheng/worker/workflow/tasks.py`中`from
bisheng.worker.main import bisheng_celery`的写法注释掉,则task中的import
bisheng_celery将会报错,例如file_worker中的代码显示:
<img width="641" height="132" alt="image"
src="https://github.com/user-attachments/assets/e2f54037-3eb8-4076-b688-7f5fead82ae4"
/>


这是一种看起来比较奇怪的现象:`workflow/tasks.py`和`test/test.py`的import影响了`knowledge/file_worker.py`,究其原因是因为`bisheng/worker/__init__.py`中将所有task注册导致表现正常,我认为更合理的做法应该是将`from
bisheng.worker.main import bisheng_celery`加到我修改地方,保证`from bisheng.worker
import bisheng_celery`的写法正常
# Conflicts:
#	src/backend/bisheng/worker/knowledge/rebuild_knowledge_worker.py
@zgqgit zgqgit merged commit 2dc897d into release Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants