Refactor: refactor dataflow_service.go and guard nats message re-delivery (#16826)

### Summary

1. refactor dataflow_service.go 
2. guard nats message re-delivery
3. support document parse cancelling & re-run
This commit is contained in:
Jack
2026-07-13 11:08:04 +08:00
committed by GitHub
parent 347a45967e
commit 3c0f8fc192
70 changed files with 4901 additions and 2401 deletions

View File

@@ -482,14 +482,8 @@ func runAdmin(args *serverArgs) error {
func runIngestor(args *serverArgs) error {
// Initialize tokenizer (rag_analyzer)
dictPath := common.GetEnv(common.EnvRAGFlowDictPath)
if dictPath == "" {
dictPath = "/usr/share/infinity/resource"
}
tokenizerCfg := &tokenizer.PoolConfig{
DictPath: dictPath,
}
if err := tokenizer.Init(tokenizerCfg); err != nil {
// tokenizer.Init handles DictPath fallback: env var → /usr/share/infinity/resource
if err := tokenizer.Init(&tokenizer.PoolConfig{}); err != nil {
common.Fatal("Failed to initialize tokenizer", zap.Error(err))
}
defer tokenizer.Close()
@@ -647,13 +641,9 @@ func runAPI(args *serverArgs) error {
local.InitAdminStatus(1, "admin server not connected")
// Initialize tokenizer (rag_analyzer)
dictPath := common.GetEnv(common.EnvRAGFlowDictPath)
if dictPath == "" {
dictPath = "/usr/share/infinity/resource"
}
tokenizerCfg := &tokenizer.PoolConfig{
DictPath: dictPath,
}
// tokenizer.Init fills DictPath from env var or default, so
// tokenizerCfg.DictPath carries the resolved path for downstream use.
tokenizerCfg := &tokenizer.PoolConfig{}
if err := tokenizer.Init(tokenizerCfg); err != nil {
common.Fatal("Failed to initialize tokenizer", zap.Error(err))
}