mirror of
				https://github.com/gitbucket/gitbucket.git
				synced 2025-10-31 10:36:05 +01:00 
			
		
		
		
	Allow to configure Jetty idle timeout in standalone mode (#3027)
This commit is contained in:
		| @@ -61,6 +61,7 @@ public class JettyLauncher { | ||||
|         String redirectHttps = getEnvironmentVariable("gitbucket.redirectHttps"); | ||||
|         String contextPath = getEnvironmentVariable("gitbucket.prefix"); | ||||
|         String tmpDirPath = getEnvironmentVariable("gitbucket.tempDir"); | ||||
|         String jettyIdleTimeout = getEnvironmentVariable("gitbucket.jettyIdleTimeout"); | ||||
|         boolean saveSessions = false; | ||||
|  | ||||
|         for(String arg: args) { | ||||
| @@ -107,6 +108,9 @@ public class JettyLauncher { | ||||
|                         case "--plugin_dir": | ||||
|                             System.setProperty("gitbucket.pluginDir", dim[1]); | ||||
|                             break; | ||||
|                         case "--jetty_idle_timeout": | ||||
|                             jettyIdleTimeout = dim[1]; | ||||
|                             break; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
| @@ -130,6 +134,11 @@ public class JettyLauncher { | ||||
|         if (connectorsSet.contains(Connectors.HTTPS)) { | ||||
|             httpConfig.setSecurePort(fallback(securePort, Defaults.HTTPS_PORT, Integer::parseInt)); | ||||
|         } | ||||
|         if (jettyIdleTimeout != null && jettyIdleTimeout.trim().length() != 0) { | ||||
|             httpConfig.setIdleTimeout(Long.parseLong(jettyIdleTimeout.trim())); | ||||
|         } else { | ||||
|             httpConfig.setIdleTimeout(300000L); // default is 5min | ||||
|         } | ||||
|  | ||||
|         if (connectorsSet.contains(Connectors.HTTP)) { | ||||
|             final ServerConnector connector = new ServerConnector(server, new HttpConnectionFactory(httpConfig)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user