-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Octokit::Middleware::Retry allows incorporating the retry logic without relying on the default middleware stack.
- Loading branch information
1 parent
2efe1b8
commit c892eb3
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Octokit | ||
module Middleware | ||
base = if defined?(Faraday::Request::Retry) | ||
Faraday::Request::Retry | ||
else | ||
require 'faraday/retry' | ||
Faraday::Retry::Middleware | ||
end | ||
|
||
# Public: Retries each request a limited number of times. | ||
class Retry < base | ||
def initialize(app, **kwargs) | ||
super(app, **kwargs, exceptions: DEFAULT_EXCEPTIONS + [Octokit::ServerError]) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters