File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
lib/fastlane/plugin/wpmreleasetoolkit/helper Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,14 @@ class GlotpressDownloader
77 AUTO_RETRY_SLEEP_TIME = 20
88 MAX_AUTO_RETRY_ATTEMPTS = 30
99
10- def initialize ( auto_retry : true )
10+ def initialize (
11+ auto_retry : true ,
12+ auto_retry_sleep_time : 20 ,
13+ auto_retry_max_attempts : 30
14+ )
1115 @auto_retry = auto_retry
16+ @auto_retry_sleep_time = auto_retry_sleep_time
17+ @auto_retry_max_attempts = auto_retry_max_attempts
1218 @auto_retry_attempt_counter = 0
1319 end
1420
@@ -24,8 +30,8 @@ def download(glotpress_url)
2430 download ( response . header [ 'location' ] )
2531 when '429' # We got rate-limited, auto_retry or offer to try again with a prompt
2632 if @auto_retry && @auto_retry_attempt_counter <= MAX_AUTO_RETRY_ATTEMPTS
27- UI . message ( "Received 429 for `#{ response . uri } `. Auto retrying in #{ AUTO_RETRY_SLEEP_TIME } seconds..." )
28- sleep ( AUTO_RETRY_SLEEP_TIME )
33+ UI . message ( "Received 429 for `#{ response . uri } `. Auto retrying in #{ @auto_retry_sleep_time } seconds..." )
34+ sleep ( @auto_retry_sleep_time )
2935 @auto_retry_attempt_counter += 1
3036 download ( response . uri )
3137 elsif UI . confirm ( "Retry downloading `#{ response . uri } ` after receiving 429 from the API?" )
You can’t perform that action at this time.
0 commit comments