Enum ApiRateLimitChecker
- All Implemented Interfaces:
Serializable
,Comparable<ApiRateLimitChecker>
-
Enum Constant Summary
Enum ConstantDescriptionIgnore GitHub API Rate limit.Attempt to evenly distribute GitHub API requests.Restrict GitHub API requests only when near or above rate limit. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkApiRateLimit
(TaskListener listener, org.kohsuke.github.GitHub gitHub) Deprecated.rate limit checking is done automatically.static void
configureThreadLocalChecker
(TaskListener listener, org.kohsuke.github.GitHub gitHub) abstract org.jenkinsci.plugins.github_branch_source.ApiRateLimitChecker.LocalChecker
getChecker
(TaskListener listener, String apiUrl) static ApiRateLimitChecker
Returns the enum constant of this type with the specified name.static ApiRateLimitChecker[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ThrottleForNormalize
Attempt to evenly distribute GitHub API requests. -
ThrottleOnOver
Restrict GitHub API requests only when near or above rate limit. -
NoThrottle
Ignore GitHub API Rate limit. Useful for GitHub Enterprise instances that might not have a limit set up.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getDisplayName
-
configureThreadLocalChecker
public static void configureThreadLocalChecker(@NonNull TaskListener listener, @NonNull org.kohsuke.github.GitHub gitHub) -
checkApiRateLimit
@Deprecated public void checkApiRateLimit(TaskListener listener, org.kohsuke.github.GitHub gitHub) throws IOException, InterruptedException Deprecated.rate limit checking is done automatically. UseconfigureThreadLocalChecker(TaskListener, GitHub)
instead.This method is the old code path for rate limit checksIt has been slowly refactored until it almost matches the behavior of the GitHubRateLimitChecker.
- Throws:
IOException
InterruptedException
-
getChecker
public abstract org.jenkinsci.plugins.github_branch_source.ApiRateLimitChecker.LocalChecker getChecker(@NonNull TaskListener listener, String apiUrl)
-