Skip to content

Commit

Permalink
Increased Read/Request timeout to 180 seconds (leapwork#53)
Browse files Browse the repository at this point in the history
Co-authored-by: Sachin Tomar <[email protected]>
  • Loading branch information
sachindevtomar and Sachin Tomar authored Nov 1, 2023
1 parent dd60e65 commit 2be482a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<version>${revision}${changelist}</version>
<packaging>hpi</packaging>
<properties>
<revision>4.0.7</revision>
<revision>4.0.8</revision>
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/leapwork-plugin</gitHubRepo>
<changelist>-SNAPSHOT</changelist>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.Leapwork.Leapwork_plugin.model.RunCollection;
import com.Leapwork.Leapwork_plugin.model.RunItem;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.AsyncHttpClientConfig;

import hudson.AbortException;
import hudson.EnvVars;
Expand Down Expand Up @@ -50,6 +51,7 @@ public class LeapworkJenkinsBridgeBuilder extends Builder implements SimpleBuild
private boolean leapworkWritePassedFlowKeyFrames;
private boolean leapworkEnableHttps;
private String leapworkScheduleVariables;
private static final int TIMEOUT_IN_SECONDS = 180;

private static PluginHandler pluginHandler = PluginHandler.getInstance();

Expand Down Expand Up @@ -170,8 +172,13 @@ public void perform(final Run<?, ?> build, FilePath workspace, Launcher launcher

String scheduleVariablesRequestPart = pluginHandler
.getScheduleVariablesRequestPart(getLeapworkScheduleVariables(), listener);

try (AsyncHttpClient mainClient = new AsyncHttpClient()) {

AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
.setReadTimeout(TIMEOUT_IN_SECONDS * 1000)
.setRequestTimeout(TIMEOUT_IN_SECONDS * 1000)
.build();

try (AsyncHttpClient mainClient = new AsyncHttpClient(config)) {

// Get schedule titles (or/and ids in case of pipeline)
LinkedHashMap<UUID, String> schedulesIdTitleHashMap = pluginHandler.getSchedulesIdTitleHashMap(mainClient,
Expand Down

0 comments on commit 2be482a

Please sign in to comment.