v1.5.1 增强程序稳定性
This commit is contained in:
@@ -31,6 +31,7 @@ type RouteManager struct {
|
||||
locker sync.RWMutex
|
||||
|
||||
notifier chan bool
|
||||
readyCh chan struct{} // 初始加载完成后关闭
|
||||
|
||||
ispRouteMap map[string]string // name => code
|
||||
chinaRouteMap map[string]string // name => code
|
||||
@@ -45,6 +46,7 @@ func NewRouteManager(db *dbs.DB) *RouteManager {
|
||||
userRouteMap: map[int64][]int64{},
|
||||
|
||||
notifier: make(chan bool, 8),
|
||||
readyCh: make(chan struct{}),
|
||||
|
||||
ispRouteMap: map[string]string{},
|
||||
chinaRouteMap: map[string]string{},
|
||||
@@ -79,6 +81,9 @@ func (this *RouteManager) Start() {
|
||||
}
|
||||
}
|
||||
|
||||
// 通知初始加载完成
|
||||
close(this.readyCh)
|
||||
|
||||
// 更新
|
||||
var ticker = time.NewTicker(1 * time.Minute)
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user