@@ -28,24 +28,29 @@ def self.run(params)
28
28
app_id = app_id_from_params ( params )
29
29
app_name = app_name_from_app_id ( app_id )
30
30
platform = lane_platform || platform_from_app_id ( app_id )
31
+ timeout = get_upload_timeout ( params )
31
32
32
33
binary_path = get_binary_path ( platform , params )
33
34
UI . user_error! ( "Couldn't find binary" ) if binary_path . nil?
34
35
UI . user_error! ( "Couldn't find binary at path #{ binary_path } " ) unless File . exist? ( binary_path )
35
36
binary_type = binary_type_from_path ( binary_path )
36
37
37
- client = init_client ( params [ :service_credentials_file ] , params [ :firebase_cli_token ] , params [ :debug ] )
38
+ # TODO(lkellogg): This sets the send timeout for all POST requests made by the client, but
39
+ # ideally the timeout should only apply to the binary upload
40
+ client = init_client ( params [ :service_credentials_file ] ,
41
+ params [ :firebase_cli_token ] ,
42
+ params [ :debug ] ,
43
+ timeout )
38
44
39
- # If binary is an AAB, get the AAB info for this app, which includes the integration state and certificate data
45
+ # If binary is an AAB, get the AAB info for this app, which includes the integration state
46
+ # and certificate data
40
47
if binary_type == :AAB
41
48
aab_info = get_aab_info ( client , app_name )
42
49
validate_aab_setup! ( aab_info )
43
50
end
44
51
45
52
binary_type = binary_type_from_path ( binary_path )
46
53
UI . message ( "⌛ Uploading the #{ binary_type } ." )
47
-
48
- timeout = get_upload_timeout ( params )
49
54
operation = upload_binary ( app_name , binary_path , client , timeout )
50
55
release = poll_upload_release_operation ( client , operation , binary_type )
51
56
@@ -242,12 +247,13 @@ def self.poll_upload_release_operation(client, operation, binary_type)
242
247
243
248
def self . upload_binary ( app_name , binary_path , client , timeout )
244
249
options = Google ::Apis ::RequestOptions . new
245
- options . max_elapsed_time = timeout
250
+ options . max_elapsed_time = timeout # includes retries (default = no retries)
246
251
options . header = {
247
252
'Content-Type' => 'application/octet-stream' ,
248
253
'X-Goog-Upload-File-Name' => File . basename ( binary_path ) ,
249
254
'X-Goog-Upload-Protocol' => 'raw'
250
255
}
256
+
251
257
# For some reason calling the client.upload_medium returns nil when
252
258
# it should return a long running operation object, so we make a
253
259
# standard http call instead and convert it to a long running object
0 commit comments