perf(全链路): 连接池/事务边界/轮询与 IO 效率收口
Java: - LLM 180s 读超时不再被全局 call-timeout 静默截断成 90s(长思考请求被掐断→重试→付费网关二次计费) - 代理 HttpClient 缓存改有界 LRU(jikip 每次提取新 IP,无界缓存持续泄漏 selector 线程与连接池) - 12 个 service 的 Redis 任务锁移出 @Transactional(自旋最坏 10s 白占 DB 连接,池仅 30),远端对象删/传改 afterCommit - 结果文件 Job 闸门拒绝时不再回退内联执行(改重新入队,避免把背压转嫁给 MQ 消费线程) - imagevideo 每秒扫描加列投影、过期清理加 LIMIT;权限页整表查询改列投影(不再拉回密码哈希) - 哈希改 HexFormat;补 5 处"不能改"的技术依据注释(批量插入会丢回填主键、流式丢模板与图片等) 前端:4 个工具页轮询改轻量端点(带 fallback);PriceTrack 快照节流写盘;候选店铺表分页;页面隐藏时停表 客户端:HTTP 连接池按出口复用(Session 仍每请求新建,保持无跨请求状态);品牌检测 WIPO 逐请求握手; 代理配置按 mtime 缓存;串行任务改专属池;异常降级为标签页重连;紫鸟启动改端口轮询;模板编译缓存; 日志上报连接与落盘收口;Flask 版本 API 改按请求复用连接
This commit is contained in:
+22
-4
@@ -297,6 +297,22 @@ public class PermissionMenuService {
|
||||
.contains(columnId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 可授权用户查询:只取「超管判定 + 列表展示」用到的列。
|
||||
*
|
||||
* <p>权限页此前一律 `selectList(new LambdaQueryWrapper<>())` 整表拉回,而 admin_user
|
||||
* 含密码哈希等敏感列,每次打开权限页都把全表(含哈希)读进内存(2026-09-15 优化)。
|
||||
* 判定用 role/is_admin/created_by_id,展示用 id/username。
|
||||
*/
|
||||
private LambdaQueryWrapper<AdminUserEntity> grantableUserQuery() {
|
||||
return new LambdaQueryWrapper<AdminUserEntity>()
|
||||
.select(AdminUserEntity::getId,
|
||||
AdminUserEntity::getUsername,
|
||||
AdminUserEntity::getRole,
|
||||
AdminUserEntity::getIsAdmin,
|
||||
AdminUserEntity::getCreatedById);
|
||||
}
|
||||
|
||||
public List<ImageVideoDataPermissionUserVo> listImageVideoDataPermissionUsers(AdminUserEntity operator) {
|
||||
ensureSuperAdminOperator(operator);
|
||||
PermissionMenuEntity dataPermission = requireImageVideoDataPermission();
|
||||
@@ -305,7 +321,7 @@ public class PermissionMenuService {
|
||||
.map(UserColumnPermissionEntity::getUserId)
|
||||
.filter(id -> id != null && id > 0)
|
||||
.collect(Collectors.toSet());
|
||||
return adminUserMapper.selectList(new LambdaQueryWrapper<AdminUserEntity>()
|
||||
return adminUserMapper.selectList(grantableUserQuery()
|
||||
.orderByAsc(AdminUserEntity::getUsername)
|
||||
.orderByAsc(AdminUserEntity::getId))
|
||||
.stream()
|
||||
@@ -319,7 +335,7 @@ public class PermissionMenuService {
|
||||
ensureSuperAdminOperator(operator);
|
||||
PermissionMenuEntity dataPermission = requireImageVideoDataPermission();
|
||||
List<Long> requestedIds = normalizeColumnIds(userIds);
|
||||
List<AdminUserEntity> users = adminUserMapper.selectList(new LambdaQueryWrapper<AdminUserEntity>());
|
||||
List<AdminUserEntity> users = adminUserMapper.selectList(grantableUserQuery());
|
||||
Map<Long, AdminUserEntity> grantableUsers = users.stream()
|
||||
.filter(user -> user.getId() != null && !isSuperAdmin(user))
|
||||
.collect(Collectors.toMap(AdminUserEntity::getId, Function.identity(), (left, right) -> left));
|
||||
@@ -345,7 +361,7 @@ public class PermissionMenuService {
|
||||
.map(UserColumnPermissionEntity::getUserId)
|
||||
.filter(id -> id != null && id > 0)
|
||||
.collect(Collectors.toSet());
|
||||
return adminUserMapper.selectList(new LambdaQueryWrapper<AdminUserEntity>()
|
||||
return adminUserMapper.selectList(grantableUserQuery()
|
||||
.orderByAsc(AdminUserEntity::getUsername)
|
||||
.orderByAsc(AdminUserEntity::getId))
|
||||
.stream()
|
||||
@@ -360,7 +376,7 @@ public class PermissionMenuService {
|
||||
PermissionMenuEntity dataPermission = requireDataPermission(
|
||||
SHOP_DATA_CRAWL_DATA_PERMISSION_KEY, "店铺数据任务数据");
|
||||
List<Long> requestedIds = normalizeColumnIds(userIds);
|
||||
List<AdminUserEntity> users = adminUserMapper.selectList(new LambdaQueryWrapper<AdminUserEntity>());
|
||||
List<AdminUserEntity> users = adminUserMapper.selectList(grantableUserQuery());
|
||||
Map<Long, AdminUserEntity> grantableUsers = users.stream()
|
||||
.filter(user -> user.getId() != null && !isSuperAdmin(user))
|
||||
.collect(Collectors.toMap(AdminUserEntity::getId, Function.identity(), (left, right) -> left));
|
||||
@@ -607,7 +623,9 @@ public class PermissionMenuService {
|
||||
}
|
||||
Set<Long> targetEffectiveIds = expandDescendantIds(
|
||||
new LinkedHashSet<>(loadDirectColumnIds(target.getId())), loadMenus(null));
|
||||
// 只用到 id:不要为一次级联清理把整表(含密码哈希)拉回
|
||||
List<AdminUserEntity> subordinates = adminUserMapper.selectList(new LambdaQueryWrapper<AdminUserEntity>()
|
||||
.select(AdminUserEntity::getId)
|
||||
.eq(AdminUserEntity::getCreatedById, target.getId()));
|
||||
for (AdminUserEntity subordinate : subordinates) {
|
||||
Long subordinateId = subordinate.getId();
|
||||
|
||||
Reference in New Issue
Block a user