Merge remote-tracking branch 'base-version/main' into dev
This commit is contained in:
@@ -36,7 +36,7 @@ public class ApiDefinitionStepSaveReqVO {
|
||||
@Schema(description = "响应映射表达式(JSON)")
|
||||
private String responseMappingExpr;
|
||||
|
||||
@Schema(description = "超时时间(毫秒)", example = "5000")
|
||||
@Schema(description = "超时时间(毫秒),缺省 20000(20s)", example = "20000")
|
||||
private Long timeout;
|
||||
|
||||
@Schema(description = "降级策略(JSON)")
|
||||
|
||||
@@ -48,6 +48,7 @@ public class HttpStepHandler implements ApiStepHandler {
|
||||
|
||||
private static final Duration RETRY_DELAY = Duration.ofMillis(200);
|
||||
private static final int RETRY_ATTEMPTS = 3;
|
||||
private static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(20);
|
||||
|
||||
private static final Set<String> DEFAULT_FORWARDED_HEADERS = Set.of(
|
||||
"authorization",
|
||||
@@ -229,7 +230,7 @@ public class HttpStepHandler implements ApiStepHandler {
|
||||
private Duration resolveTimeout(ApiStepDefinition stepDefinition) {
|
||||
Long timeout = stepDefinition.getStep().getTimeout();
|
||||
if (timeout == null || timeout <= 0) {
|
||||
return Duration.ofSeconds(5);
|
||||
return DEFAULT_TIMEOUT;
|
||||
}
|
||||
return Duration.ofMillis(timeout);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user