2016-05-17 10:29:49 +00:00
|
|
|
#!/usr/bin/env ruby -w
|
|
|
|
|
|
|
|
seconds_to_reach = 10 * 60
|
|
|
|
retry_max_interval = 128
|
|
|
|
|
|
|
|
current_interval = 2
|
|
|
|
total_interval = 0
|
|
|
|
exceptions_count = 1
|
|
|
|
|
|
|
|
loop do
|
2016-05-17 15:21:37 +00:00
|
|
|
break if total_interval > seconds_to_reach
|
2016-05-17 10:29:49 +00:00
|
|
|
exceptions_count += 1
|
2016-05-17 15:21:37 +00:00
|
|
|
|
|
|
|
current_interval = current_interval * 2 > retry_max_interval ? retry_max_interval : current_interval * 2
|
2016-05-17 10:29:49 +00:00
|
|
|
|
|
|
|
total_interval += current_interval
|
|
|
|
end
|
|
|
|
|
|
|
|
puts exceptions_count
|