mutate calls the github api with a graphql mutation and sends a core.ExportResult for each rate limiting event
(ctx context.Context, m interface{}, input githubv4.Input, vars map[string]interface{}, out chan<- core.ExportResult)
| 32 | |
| 33 | // mutate calls the github api with a graphql mutation and sends a core.ExportResult for each rate limiting event |
| 34 | func (c *rateLimitHandlerClient) mutate(ctx context.Context, m interface{}, input githubv4.Input, vars map[string]interface{}, out chan<- core.ExportResult) error { |
| 35 | // prepare a closure for the mutation |
| 36 | mutFun := func(ctx context.Context) error { |
| 37 | return c.sc.Mutate(ctx, m, input, vars) |
| 38 | } |
| 39 | callback := func(msg string) { |
| 40 | select { |
| 41 | case <-ctx.Done(): |
| 42 | case out <- core.NewExportRateLimiting(msg): |
| 43 | } |
| 44 | } |
| 45 | return c.callAPIAndRetry(ctx, mutFun, callback) |
| 46 | } |
| 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 { |
no test coverage detected