v1.5.1 增强程序稳定性
This commit is contained in:
@@ -22,6 +22,7 @@ type KeyManager struct {
|
||||
version int64
|
||||
|
||||
notifier chan bool
|
||||
readyCh chan struct{} // 初始加载完成后关闭
|
||||
}
|
||||
|
||||
// NewKeyManager 获取密钥管理器
|
||||
@@ -31,6 +32,7 @@ func NewKeyManager(db *dbs.DB) *KeyManager {
|
||||
zoneKeyMap: map[int64]*models.NSKeys{},
|
||||
db: db,
|
||||
notifier: make(chan bool, 8),
|
||||
readyCh: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +60,9 @@ func (this *KeyManager) Start() {
|
||||
}
|
||||
}
|
||||
|
||||
// 通知初始加载完成
|
||||
close(this.readyCh)
|
||||
|
||||
// 更新
|
||||
var ticker = time.NewTicker(1 * time.Minute)
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user