Commit 9953bfb3 authored by zhouwei's avatar zhouwei

设置请求超时

parent fb31b6af
......@@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration;
public class AppConfig {
@Value("${alert.host}")
String alertHost;
@Value("${gateway.request.timeout:30000}")
@Value("${gateway.request.timeout:180000}")
private Integer requestTimeout;
@Value("${gateway.window.time:600000}")
......
......@@ -317,6 +317,7 @@ public class FailoverGatewayFilterFactory extends AbstractGatewayFilterFactory<F
return requestBodySpec
.exchange()
.timeout(Duration.ofMillis(requestTimeout))
.flatMap(clientResponse -> handleResponse(exchange, clientResponse, isSourceRequest, errorStats))
.doFinally(signalType -> {
long endTime = System.currentTimeMillis();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment