(ctx context.Context)
| 128 | } |
| 129 | |
| 130 | func (c *Client) pollScriptStats(ctx context.Context) { |
| 131 | c.endpointMu.Lock() |
| 132 | urls := make([]string, len(c.endpoints)) |
| 133 | for i := range c.endpoints { |
| 134 | urls[i] = c.endpoints[i].url |
| 135 | } |
| 136 | c.endpointMu.Unlock() |
| 137 | |
| 138 | for i, url := range urls { |
| 139 | if ctx.Err() != nil { |
| 140 | return |
| 141 | } |
| 142 | c.fetchScriptStats(ctx, i, url) |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | func (c *Client) fetchScriptStats(ctx context.Context, idx int, url string) { |
| 147 | reqCtx, cancel := context.WithTimeout(ctx, scriptStatsRequestTimeout) |
no test coverage detected