pilot/lib/pilot/build_manager.rb in fastlane-2.96.0.beta.20180515050025 vs pilot/lib/pilot/build_manager.rb in fastlane-2.96.0.beta.20180516050022

- old
+ new

@@ -168,10 +168,19 @@ # This is where we could add a check to see if encryption is required and has been updated uploaded_build.export_compliance.encryption_updated = false if options[:groups] || options[:distribute_external] uploaded_build.beta_review_info.demo_account_required = options[:demo_account_required] # this needs to be set for iTC to continue - uploaded_build.submit_for_testflight_review! + begin + uploaded_build.submit_for_testflight_review! + rescue => ex + # iTunes Connect currently may 504 on this request even though it manages to get the build in + # the approved state, this is a temporary workaround. + raise ex unless ex.to_s.include?("504") + UI.message("Submitting the build for review timed out, trying to recover.") + updated_build = Spaceship::TestFlight::Build.find(app_id: uploaded_build.app_id, build_id: uploaded_build.id) + raise ex unless updated_build.approved? + end end if options[:groups] groups = Spaceship::TestFlight::Group.filter_groups(app_id: uploaded_build.app_id) do |group| options[:groups].include?(group.name)