Add configuration for jetty idle timeout

Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com>
Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
Committed-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
This commit is contained in:
Rene Pfeuffer
2024-02-07 11:13:17 +01:00
parent d8e1f2d739
commit f894d7fe3b
7 changed files with 27 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ public class ServerConfigYaml {
private String tempDir = "work/scm";
// Resolves the client ip instead of the reverse proxy ip if the X-Forwarded-For header is present
private boolean forwardHeadersEnabled = false;
private int idleTimeout = 0;
// ### SSL-related config
// Only configure SSL if the key store path is set
@@ -149,6 +150,14 @@ public class ServerConfigYaml {
this.forwardHeadersEnabled = forwardHeadersEnabled;
}
public int getIdleTimeout() {
return getEnvWithDefault("IDLE_TIMEOUT", idleTimeout);
}
public void setIdleTimeout(int idleTimeout) {
this.idleTimeout = idleTimeout;
}
static int getEnvWithDefault(String envKey, int configValue) {
String value = getEnv(envKey);
return value != null ? Integer.parseInt(value) : configValue;