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
7
7
AUTO_RETRY_SLEEP_TIME = 20
8
8
MAX_AUTO_RETRY_ATTEMPTS = 30
9
9
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
+ )
11
15
@auto_retry = auto_retry
16
+ @auto_retry_sleep_time = auto_retry_sleep_time
17
+ @auto_retry_max_attempts = auto_retry_max_attempts
12
18
@auto_retry_attempt_counter = 0
13
19
end
14
20
@@ -24,8 +30,8 @@ def download(glotpress_url)
24
30
download ( response . header [ 'location' ] )
25
31
when '429' # We got rate-limited, auto_retry or offer to try again with a prompt
26
32
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 )
29
35
@auto_retry_attempt_counter += 1
30
36
download ( response . uri )
31
37
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