解决接口响应超时
This commit is contained in:
parent
4a6cca7373
commit
9652eea78b
8
pom.xml
8
pom.xml
|
@ -194,6 +194,14 @@
|
||||||
<version>1.2.62</version>
|
<version>1.2.62</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 配置注解处理器-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.greenorange.promotion.annotation.Timeout;
|
||||||
import com.greenorange.promotion.common.ErrorCode;
|
import com.greenorange.promotion.common.ErrorCode;
|
||||||
import com.greenorange.promotion.exception.BusinessException;
|
import com.greenorange.promotion.exception.BusinessException;
|
||||||
import com.greenorange.promotion.exception.ThrowUtils;
|
import com.greenorange.promotion.exception.ThrowUtils;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.annotation.Before;
|
import org.aspectj.lang.annotation.Before;
|
||||||
import org.aspectj.lang.annotation.Pointcut;
|
import org.aspectj.lang.annotation.Pointcut;
|
||||||
|
@ -21,6 +22,7 @@ public class TimeoutAspect {
|
||||||
|
|
||||||
private final ExecutorService executorService;
|
private final ExecutorService executorService;
|
||||||
|
|
||||||
|
|
||||||
// 构造器注入线程池
|
// 构造器注入线程池
|
||||||
@Autowired
|
@Autowired
|
||||||
public TimeoutAspect(ExecutorService executorService) {
|
public TimeoutAspect(ExecutorService executorService) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user