v1.5.1 增强程序稳定性
This commit is contained in:
@@ -22,13 +22,15 @@ type Manager struct {
|
||||
|
||||
db *dbs.DB
|
||||
|
||||
lastId int64
|
||||
lastId int64
|
||||
ReadyCh chan struct{} // 初始加载完成后关闭
|
||||
}
|
||||
|
||||
func NewManager(db *dbs.DB) *Manager {
|
||||
return &Manager{
|
||||
ipMap: map[string]string{},
|
||||
db: db,
|
||||
ipMap: map[string]string{},
|
||||
db: db,
|
||||
ReadyCh: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +53,9 @@ func (this *Manager) Start() {
|
||||
}
|
||||
}
|
||||
|
||||
// 通知初始加载完成
|
||||
close(this.ReadyCh)
|
||||
|
||||
// 定时获取
|
||||
var duration = 30 * time.Minute
|
||||
if Tea.IsTesting() {
|
||||
|
||||
Reference in New Issue
Block a user