queryImport calls the github api with a graphql query, and sends an ImportEvent for each rate limiting event
(ctx context.Context, query interface{}, vars map[string]interface{}, importEvents chan<- ImportEvent)
| 47 | |
| 48 | // queryImport calls the github api with a graphql query, and sends an ImportEvent for each rate limiting event |
| 49 | func (c *rateLimitHandlerClient) queryImport(ctx context.Context, query interface{}, vars map[string]interface{}, importEvents chan<- ImportEvent) error { |
| 50 | // prepare a closure for the query |
| 51 | queryFun := func(ctx context.Context) error { |
| 52 | return c.sc.Query(ctx, query, vars) |
| 53 | } |
| 54 | callback := func(msg string) { |
| 55 | select { |
| 56 | case <-ctx.Done(): |
| 57 | case importEvents <- RateLimitingEvent{msg}: |
| 58 | } |
| 59 | } |
| 60 | return c.callAPIAndRetry(ctx, queryFun, callback) |
| 61 | } |
| 62 | |
| 63 | // queryExport calls the github api with a graphql query, and sends a core.ExportResult for each rate limiting event |
| 64 | func (c *rateLimitHandlerClient) queryExport(ctx context.Context, query interface{}, vars map[string]interface{}, out chan<- core.ExportResult) error { |
no test coverage detected