Skip to content

Commit 590a908

Browse files
authored
Merge pull request #3 from browserstack/develop
Fixing issue with app upload read time out.
2 parents b9a9f60 + b55e5cf commit 590a908

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/com/browserstack/appautomate/AppAutomateClient.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.browserstack.automate.model.Build;
1313
import com.browserstack.automate.model.Session;
1414
import com.browserstack.client.BrowserStackClient;
15+
import com.browserstack.client.BrowserStackRequest;
1516
import com.browserstack.client.exception.BrowserStackException;
1617
import com.browserstack.client.util.Tools;
1718
import com.google.api.client.http.FileContent;
@@ -75,8 +76,10 @@ public AppUploadResponse uploadApp(String filePath)
7576
String.format("form-data; name=\"file\"; filename=\"%s\"", file.getName())));
7677
content.addPart(part);
7778

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);
8083

8184
if (appUploadResponse == null || Tools.isStringEmpty(appUploadResponse.getAppUrl())) {
8285
throw new AppAutomateException("App upload failed!", 0);

0 commit comments

Comments
 (0)