新增对象存储/账单/保留IP模块,删桶并发提速与成本增强
CI / test (push) Successful in 33s

This commit is contained in:
2026-07-21 12:11:05 +08:00
parent 9cfde8b702
commit f40f2a20e8
44 changed files with 7788 additions and 54 deletions
+8 -1
View File
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"strings"
"sync"
"time"
"gorm.io/gorm"
@@ -23,11 +24,17 @@ type OciConfigService struct {
// auditRaw 按 configId:eventId 暂存审计原始事件(TTL 10 分钟),
// 列表响应剥离 raw 后详情接口据此秒开;miss 走小窗重查兜底。
auditRaw *cache.Cache
// bindWG 追踪保留 IP 后台绑定 goroutine;bindStop 关服时令其提前退出。
bindWG sync.WaitGroup
bindStop chan struct{}
}
// NewOciConfigService 组装依赖。
func NewOciConfigService(db *gorm.DB, cipher *crypto.Cipher, client oci.Client) *OciConfigService {
return &OciConfigService{db: db, cipher: cipher, client: client, auditRaw: cache.New(auditRawMax)}
return &OciConfigService{
db: db, cipher: cipher, client: client,
auditRaw: cache.New(auditRawMax), bindStop: make(chan struct{}),
}
}
// SetTenantCleanupDeps 注入租户删除提交后的任务内存状态同步依赖。