queryPrintMsgs calls the github api with a graphql query, and prints a message to stdout for every rate limiting event .
(ctx context.Context, query interface{}, vars map[string]interface{})
| 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 { |
| 80 | // prepare a closure for the query |
| 81 | queryFun := func(ctx context.Context) error { |
| 82 | return c.sc.Query(ctx, query, vars) |
| 83 | } |
| 84 | callback := func(msg string) { |
| 85 | fmt.Println(msg) |
| 86 | } |
| 87 | return c.callAPIAndRetry(ctx, queryFun, callback) |
| 88 | } |
| 89 | |
| 90 | // callAPIAndRetry calls the Github GraphQL API (indirectly through callAPIDealWithLimit) and in |
| 91 | // case of error it repeats the request to the Github API. The parameter `apiCall` is intended to be |
no test coverage detected