queryExport calls the github api with a graphql query, and sends a core.ExportResult for each rate limiting event
(ctx context.Context, query interface{}, vars map[string]interface{}, out chan<- core.ExportResult)
| 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 { |
| 65 | // prepare a closure for the query |
| 66 | queryFun := func(ctx context.Context) error { |
| 67 | return c.sc.Query(ctx, query, vars) |
| 68 | } |
| 69 | callback := func(msg string) { |
| 70 | select { |
| 71 | case <-ctx.Done(): |
| 72 | case out <- core.NewExportRateLimiting(msg): |
| 73 | } |
| 74 | } |
| 75 | return c.callAPIAndRetry(ctx, queryFun, callback) |
| 76 | } |
| 77 | |
| 78 | // queryPrintMsgs calls the github api with a graphql query, and prints a message to stdout for every rate limiting event . |
| 79 | func (c *rateLimitHandlerClient) queryPrintMsgs(ctx context.Context, query interface{}, vars map[string]interface{}) error { |
no test coverage detected