()
| 41 | } |
| 42 | |
| 43 | func (this *SyncAPINodesTask) Start() { |
| 44 | this.ticker = time.NewTicker(5 * time.Minute) |
| 45 | if Tea.IsTesting() { |
| 46 | // 快速测试 |
| 47 | this.ticker = time.NewTicker(1 * time.Minute) |
| 48 | } |
| 49 | for range this.ticker.C { |
| 50 | err := this.Loop() |
| 51 | if err != nil { |
| 52 | logs.Println("[TASK][SYNC_API_NODES_TASK]" + err.Error()) |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | func (this *SyncAPINodesTask) Stop() { |
| 58 | if this.ticker != nil { |