tik集成
This commit is contained in:
@@ -121,6 +121,15 @@ public class TikHupController {
|
||||
}
|
||||
return applicationResult.getOutput().getWorkflowMessage().getMessage().getContent();
|
||||
})
|
||||
// 【新增】设置超时时间:30分钟内没有数据则超时
|
||||
.timeout(java.time.Duration.ofMinutes(30))
|
||||
// 【新增】超时后返回错误信息
|
||||
.onErrorResume(java.util.concurrent.TimeoutException.class, e -> {
|
||||
log.warn("流式输出超时(30分钟无数据),连接已断开");
|
||||
return Flux.just("[TIMEOUT]流式输出超时,请检查网络或重新请求");
|
||||
})
|
||||
// 【新增】流式输出完成后,发送结束标记
|
||||
.concatWith(Flux.just("[DONE]"))
|
||||
// 4.4 流处理异常捕获(如网络中断、阿里 SDK 内部错误)
|
||||
.onErrorMap(e -> {
|
||||
log.error("流式处理异常", e); // 打印完整异常栈,便于排查
|
||||
|
||||
@@ -82,7 +82,9 @@ public class TikHupServiceImpl implements TikHupService{
|
||||
.asString();
|
||||
}
|
||||
Long userId = SecurityFrameworkUtils.getLoginUser().getId();
|
||||
return response;
|
||||
if(response.getBody() != null){
|
||||
return response.getBody();
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("{}接口调用异常",url);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user