|
|
@@ -30,6 +30,9 @@ public class VectorConfig {
|
|
|
@Value("${ollama.timeout:60000}")
|
|
|
private int ollamaTimeout;
|
|
|
|
|
|
+ @Value("${ner.python-service.timeout:300000}")
|
|
|
+ private int nerServiceTimeout;
|
|
|
+
|
|
|
/**
|
|
|
* Ollama WebClient Bean
|
|
|
* 用于调用 Ollama Embedding API
|
|
|
@@ -55,12 +58,14 @@ public class VectorConfig {
|
|
|
/**
|
|
|
* 通用 RestTemplate Bean
|
|
|
* 用于调用外部 HTTP 服务(如 Python NER 服务)
|
|
|
+ * NER 服务使用 DeepSeek API,处理长文档需要较长时间
|
|
|
*/
|
|
|
@Bean
|
|
|
public RestTemplate restTemplate(RestTemplateBuilder builder) {
|
|
|
+ log.info("初始化 RestTemplate: nerServiceTimeout={}ms", nerServiceTimeout);
|
|
|
return builder
|
|
|
.setConnectTimeout(Duration.ofSeconds(10))
|
|
|
- .setReadTimeout(Duration.ofSeconds(60))
|
|
|
+ .setReadTimeout(Duration.ofMillis(nerServiceTimeout))
|
|
|
.build();
|
|
|
}
|
|
|
}
|