jx: GitHub API quotas being exceeded

Looks like we are starting to run up against GitHub API quota limits, which seem to be capped at 5,000 calls per hour.

12:02:30 GitHub API Usage: Current quota has 3375 remaining (593 over budget). Next quota of 5000 in 59 min. Sleeping for 9 min 55 sec.
12:05:30 GitHub API Usage: The quota may have been refreshed earlier than expected, rechecking...
12:05:30 GitHub API Usage: Current quota has 3375 remaining (406 over budget). Next quota of 5000 in 56 min. Sleeping for 6 min 54 sec.

Not sure why this reports 3375 remaining but then says is over budget and sleeps. Mismatched values somewhere in the checks?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

@renatomariscal @lasote The total quota for the hour is 5000. The plugin is trying to make sure you stay within quota by calculating how much time in the hour has gone by. For example, if you are 45 minutes away from a refresh in quota, the plugin expects you to have 3/4 of your quota, or 3750 (45/60*5000) available. If you only have 3700 available, it won’t make an API call.

I’m not saying I agree with the implementation, but that’s how it works.

Does anyone know how to explain the (apparent) mismatch in numbers? Current quota has >0 remaining and it still goes to sleep.