File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/com/browserstack/appautomate Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 12
12
import com .browserstack .automate .model .Build ;
13
13
import com .browserstack .automate .model .Session ;
14
14
import com .browserstack .client .BrowserStackClient ;
15
+ import com .browserstack .client .BrowserStackRequest ;
15
16
import com .browserstack .client .exception .BrowserStackException ;
16
17
import com .browserstack .client .util .Tools ;
17
18
import com .google .api .client .http .FileContent ;
@@ -75,8 +76,10 @@ public AppUploadResponse uploadApp(String filePath)
75
76
String .format ("form-data; name=\" file\" ; filename=\" %s\" " , file .getName ())));
76
77
content .addPart (part );
77
78
78
- AppUploadResponse appUploadResponse =
79
- newRequest (Method .POST , "/upload" ).body (content ).asObject (AppUploadResponse .class );
79
+ BrowserStackRequest request = newRequest (Method .POST , "/upload" );
80
+ // Setting read timeout to 0(infinity), as for large files it takes a lot of time.
81
+ request .getHttpRequest ().setReadTimeout (0 );
82
+ AppUploadResponse appUploadResponse = request .body (content ).asObject (AppUploadResponse .class );
80
83
81
84
if (appUploadResponse == null || Tools .isStringEmpty (appUploadResponse .getAppUrl ())) {
82
85
throw new AppAutomateException ("App upload failed!" , 0 );
You can’t perform that action at this time.
0 commit comments