Don't exceed rate limits
This does two things:
- Expose the remaining rate limit and reset time when the
--debug
flag is on. - Wait for the Rate limit to be reset if it's lower than 25 (arbitrary number).
As you can see in https://gitlab.com/gitlab-org/quality/triage-ops/-/jobs/267416985, this seems to work pretty well (without that I was getting an /usr/local/bundle/bundler/gems/gitlab-triage-f6ccb8ec335c/lib/gitlab/triage/network.rb:49:in `map!': undefined method `with_indifferent_access' for #<String:0x000056299e9f1d98> (NoMethodError)
error that was probably happening because the response is a plain text error (e.g. Rate limit exceeded
) rather than a JSON one....
Edited by Rémy Coutable