(doneChan chan struct{})
| 135 | } |
| 136 | |
| 137 | func (d *downstream) startPing(doneChan chan struct{}) { |
| 138 | go func() { |
| 139 | for { |
| 140 | select { |
| 141 | case <-doneChan: |
| 142 | return |
| 143 | case <-time.After(time.Second * 15): |
| 144 | if d.client != nil { |
| 145 | ctx, cancel := context.WithTimeout(d.sync.ctx, time.Second*20) |
| 146 | _, err := d.client.Ping(ctx, &remote.Empty{}) |
| 147 | cancel() |
| 148 | if err != nil { |
| 149 | d.sync.Stop(fmt.Errorf("ping connection: %v", err)) |
| 150 | return |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | }() |
| 156 | } |
| 157 | |
| 158 | func (d *downstream) mainLoop() error { |
| 159 | lastAmountChanges := int64(0) |
nothing calls this directly
no test coverage detected