@@ -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 注入租户删除提交后的任务内存状态同步依赖。
|
||||
|
||||
Reference in New Issue
Block a user