Compare commits

..

No commits in common. "96625fc77a4e9c2639c8330c35a99ecf28175d3a" and "718bbf9ddd0914eccc87ea74afef732b900195b4" have entirely different histories.

4 changed files with 2 additions and 32 deletions

View File

@ -133,32 +133,6 @@ public class ThreadPoolConfig {
return executor;
}
/**
* 审计事件处理线程池 - 使用虚拟线程Java 21+
*
* 为什么使用虚拟线程
* 1. 审计事件处理是**I/O密集型**任务写日志写数据库
* 2. 虚拟线程在I/O阻塞时不占用OS线程资源消耗极低
* 3. 审计事件量可能很大虚拟线程支持高并发处理
* 4. 独立线程池避免与业务线程池竞争资源
*
* 💡 场景
* - 异步记录用户操作审计日志
* - 写入审计数据库
* - 发送审计事件到消息队列
*
* 🎯 解决问题
* - 修复 "More than one TaskExecutor bean found" 警告
* - 确保审计事件处理不受其他业务线程池影响
*/
@Bean("auditTaskExecutor")
public SimpleAsyncTaskExecutor auditTaskExecutor() {
SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor("audit-virtual-");
executor.setVirtualThreads(true);
executor.setConcurrencyLimit(-1); // 无限制支持大量并发审计事件
return executor;
}
// ========== 注意 ==========
// sshOutputExecutor 已迁移到 Framework
// : framework.ssh.websocket.SSHWebSocketConfig

View File

@ -42,11 +42,7 @@ public class AuditAspect {
} catch (Exception e) {
// 记录异常信息
metadata.setDetail(metadata.getDetail() + " [Error: " + e.getMessage() + "]");
// 发布审计事件
eventPublisher.publishEvent(new AuditEvent(this, metadata));
// 重新抛出异常
throw e;
}
}

View File

@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
@Component
public class AuditEventListener {
@Async("auditTaskExecutor")
@Async
@EventListener
public void handleAuditEvent(AuditEvent event) {
// 这里可以将审计信息保存到数据库或发送到日志系统

View File

@ -317,7 +317,7 @@ export const LogViewerWindow: React.FC<LogViewerWindowProps> = ({
<SelectTrigger className="h-7 w-40 text-xs">
<SelectValue placeholder="选择Pod" />
</SelectTrigger>
<SelectContent className="z-[9999]">
<SelectContent>
{podNames.map((name) => (
<SelectItem key={name} value={name}>
{name}