diff options
author | vasraz <vasyl.razinkov@est.tech> | 2022-02-24 09:17:07 +0000 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2022-02-28 18:03:31 +0000 |
commit | 5eec3c5ec841aaca0a64e10028197a47ed2acbc6 (patch) | |
tree | c4792774340cc9f93bc9404df6b239fd349e2079 /catalog-fe/src/main | |
parent | 1b801c491fba4af71536f492c7085cb8f1c4b982 (diff) |
Increase FE timout
Change-Id: Id25eb2931119404a90a48ee7a50b286c975a6f82
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Issue-ID: SDC-3886
Diffstat (limited to 'catalog-fe/src/main')
-rw-r--r-- | catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java index e74893f714..891bc4ae34 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java @@ -33,8 +33,7 @@ import org.slf4j.LoggerFactory; public abstract class SSLProxyServlet extends ProxyServlet { private static final long serialVersionUID = 1L; - private static final int TIMEOUT = 600000; - private static Logger log = LoggerFactory.getLogger(SSLProxyServlet.class.getName()); + private static final Logger log = LoggerFactory.getLogger(SSLProxyServlet.class); @Override protected HttpClient createHttpClient() throws ServletException { @@ -42,17 +41,19 @@ public abstract class SSLProxyServlet extends ProxyServlet { .getConfiguration(); boolean isSecureClient = !config.getBeProtocol().equals(BeProtocol.HTTP.getProtocolName()); HttpClient client = (isSecureClient) ? getSecureHttpClient() : super.createHttpClient(); - setTimeout(TIMEOUT); - client.setIdleTimeout(TIMEOUT); - client.setStopTimeout(TIMEOUT); + int requestTimeout = config.getRequestTimeout() * 1000; + if (requestTimeout == 0) { + requestTimeout = 1200_000; + } + setTimeout(requestTimeout); + client.setIdleTimeout(requestTimeout); + client.setStopTimeout(requestTimeout); return client; } private HttpClient getSecureHttpClient() throws ServletException { - // Instantiate and configure the SslContextFactory - SslContextFactory sslContextFactory = new SslContextFactory(true); // Instantiate HttpClient with the SslContextFactory - HttpClient httpClient = new HttpClient(sslContextFactory); + final var httpClient = new HttpClient(new SslContextFactory.Client(true)); // Configure HttpClient, for example: httpClient.setFollowRedirects(false); // Start HttpClient |