File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,11 +41,11 @@ func InitController() error {
4141 cache .New (time .Duration (GlobalConfig .LOAD_STRATEGIES_INTERVAL )* time .Second , 30 * time .Second ),
4242 cache .New (10 * time .Minute , 10 * time .Minute )}
4343
44- go controller .loadStrategiesForever ()
4544 go controller .processStrategyResultForever ()
4645 go controller .processStrategyEventForever ()
4746 go controller .checkNodesForever ()
4847 go controller .startHttpServer ()
48+ go controller .loadStrategiesForever ()
4949
5050 return nil
5151}
Original file line number Diff line number Diff line change @@ -14,11 +14,15 @@ func (c *Controller) loadStrategiesForever() {
1414 products := mydb .GetProducts ()
1515 // 更新产品线告警队列
1616 c .refreshQueue (products )
17- for _ , product := range products {
18- if len (c .nodePool .Nodes ) == 0 {
19- lg .Error ("no inspector connected, do not generate task" )
17+ for {
18+ if len (c .nodePool .Nodes ) != 0 {
2019 break
2120 }
21+ lg .Warn ("no inspector connected, do not generate task, retry after 1 seconds" )
22+ time .Sleep (time .Second )
23+ }
24+
25+ for _ , product := range products {
2226 // 根据产品线 id 获取策略
2327 strategies := mydb .GetStrategies (product .ID )
2428 wg .Add (1 )
You can’t perform that action at this time.
0 commit comments