diff --git a/pom.xml b/pom.xml index 7943bba..8238616 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ ${revision}${changelist} hpi - 4.0.7 + 4.0.8 -SNAPSHOT jenkinsci/leapwork-plugin -SNAPSHOT diff --git a/src/main/java/com/Leapwork/Leapwork_plugin/LeapworkJenkinsBridgeBuilder.java b/src/main/java/com/Leapwork/Leapwork_plugin/LeapworkJenkinsBridgeBuilder.java index a20177c..33b266a 100644 --- a/src/main/java/com/Leapwork/Leapwork_plugin/LeapworkJenkinsBridgeBuilder.java +++ b/src/main/java/com/Leapwork/Leapwork_plugin/LeapworkJenkinsBridgeBuilder.java @@ -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; @@ -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(); @@ -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 schedulesIdTitleHashMap = pluginHandler.getSchedulesIdTitleHashMap(mainClient,