测试线程池
parent
9a342d1cd8
commit
5c8e646819
|
@ -10,6 +10,7 @@ import com.muyu.mapper.TaskMapper;
|
||||||
import com.muyu.service.*;
|
import com.muyu.service.*;
|
||||||
import com.muyu.task.feign.DataValueClient;
|
import com.muyu.task.feign.DataValueClient;
|
||||||
import com.muyu.task.feign.RuleFeign;
|
import com.muyu.task.feign.RuleFeign;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -230,12 +231,17 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, TaskInfo> implement
|
||||||
return "success";
|
return "success";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
private void selectAndAdd(Long databaseId,Long basicId,String sql,Long tableId,
|
private void selectAndAdd(Long databaseId,Long basicId,String sql,Long tableId,
|
||||||
HashMap<String,String> newAndOldMap,Long finalFirstArray ,Integer two) {
|
HashMap<String,String> newAndOldMap,Long finalFirstArray ,Integer two) {
|
||||||
log.info("开始查询数据");
|
log.info("开始查询数据");
|
||||||
log.info("sql{}", sql);
|
log.info("sql{}", sql);
|
||||||
log.info("数组为{},,{}", finalFirstArray, two);
|
log.info("数组为{},,{}", finalFirstArray, two);
|
||||||
DataValue[][] tableValue = dataValueClient.findTableValueToArray(databaseId, sql, finalFirstArray, two);
|
DataValue[][] tableValue = dataValueClient.findTableValueToArray(databaseId, sql, finalFirstArray, two);
|
||||||
|
System.out.println("aaa"+tableValue.length);
|
||||||
|
System.out.println("aaa"+tableValue.length);
|
||||||
|
System.out.println("aaa"+tableValue.length);
|
||||||
|
System.out.println("aaa"+tableValue.length);
|
||||||
log.info("远程调用完毕,调用数量{}", tableValue.length);
|
log.info("远程调用完毕,调用数量{}", tableValue.length);
|
||||||
for (DataValue[] dataValues : tableValue) {
|
for (DataValue[] dataValues : tableValue) {
|
||||||
for (DataValue dataValue : dataValues) {
|
for (DataValue dataValue : dataValues) {
|
||||||
|
|
|
@ -298,8 +298,9 @@ public class PriorityThreadPool {
|
||||||
try {
|
try {
|
||||||
log.info("开始执行任务");
|
log.info("开始执行任务");
|
||||||
task.run();
|
task.run();
|
||||||
log.info("执行任务完毕??");
|
|
||||||
} finally {
|
} finally {
|
||||||
|
log.info("执行任务完毕??");
|
||||||
lowPrioritySemaphore.release();
|
lowPrioritySemaphore.release();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,6 +11,7 @@ nacos:
|
||||||
# text cloud-2112
|
# text cloud-2112
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
application:
|
application:
|
||||||
|
@ -19,13 +20,14 @@ spring:
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
|
||||||
cloud:
|
cloud:
|
||||||
# openfeign:
|
openfeign:
|
||||||
# client:
|
client:
|
||||||
# config:
|
config:
|
||||||
# default:
|
default:
|
||||||
# connectTimeout: 500000 # 连接超时时间,单位为毫秒
|
connectTimeout: 5000
|
||||||
# readTimeout: 500000 # 读取超时时间,单位为毫秒
|
readTimeout: 5000
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
|
@ -68,10 +70,4 @@ mybatis-plus:
|
||||||
logic-not-delete-value: 0 # 逻辑未删除标记值,例如设置为 0 表示未删除
|
logic-not-delete-value: 0 # 逻辑未删除标记值,例如设置为 0 表示未删除
|
||||||
banner: false # 关闭控制台打印的 MyBatis-Plus Banner
|
banner: false # 关闭控制台打印的 MyBatis-Plus Banner
|
||||||
|
|
||||||
#feign:
|
|
||||||
# client:
|
|
||||||
# config:
|
|
||||||
# ## default 设置的全局超时时间,指定服务名称可以设置单个服务的超时时间
|
|
||||||
# default:
|
|
||||||
# connectTimeout: 5000
|
|
||||||
# readTimeout: 5000
|
|
||||||
|
|
Loading…
Reference in New Issue