File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -135,10 +135,19 @@ namespace :docker do
135
135
return File . read ( cache_path )
136
136
end
137
137
138
- head_hash = `curl -fs -H 'accept: application/vnd.github.v3.sha' https://api.github.com/repos/ruby/ruby/commits/master` . chomp
139
- unless $?. success?
140
- raise "get_ruby_master_head_hash failed: #{ head_hash . inspect } "
138
+ count = 5
139
+
140
+ loop do
141
+ head_hash = `curl -fs -H 'accept: application/vnd.github.v3.sha' https://api.github.com/repos/ruby/ruby/commits/master` . chomp
142
+ if $?. success? || count . zero?
143
+ break
144
+ else
145
+ p "get_ruby_master_head_hash failed: #{ head_hash . inspect } "
146
+ count -= 1
147
+ sleep 5
148
+ end
141
149
end
150
+
142
151
if cache_path
143
152
File . write ( cache_path , head_hash )
144
153
end
You can’t perform that action at this time.
0 commit comments