mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-19 14:11:04 +08:00
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:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user