./lib/shenzhen/plugins/testflight.rb in shenzhen-0.5.0 vs ./lib/shenzhen/plugins/testflight.rb in shenzhen-0.5.1
- old
+ new
@@ -8,11 +8,11 @@
class Client
HOSTNAME = 'testflightapp.com'
def initialize(api_token, team_token)
@api_token, @team_token = api_token, team_token
- @connection = Faraday.new(:url => "http://#{HOSTNAME}") do |builder|
+ @connection = Faraday.new(:url => "http://#{HOSTNAME}", :request => { :timeout => 120 }) do |builder|
builder.request :multipart
builder.request :json
builder.response :json, :content_type => /\bjson$/
builder.use FaradayMiddleware::FollowRedirects
builder.adapter :net_http
@@ -31,9 +31,12 @@
end
@connection.post("/api/builds.json", options).on_complete do |env|
yield env[:status], env[:body] if block_given?
end
+
+ rescue Faraday::Error::TimeoutError
+ say_error "Timed out while uploading build. Check https://testflightapp.com/dashboard/applications/ to see if the upload was completed." and abort
end
end
end
end