diff --git a/src/chocolatey/infrastructure.app/ApplicationParameters.cs b/src/chocolatey/infrastructure.app/ApplicationParameters.cs index d74d77755d..63f2752523 100644 --- a/src/chocolatey/infrastructure.app/ApplicationParameters.cs +++ b/src/chocolatey/infrastructure.app/ApplicationParameters.cs @@ -132,7 +132,6 @@ public static class ConfigSettings { public static readonly string CacheLocation = "cacheLocation"; public static readonly string ContainsLegacyPackageInstalls = "containsLegacyPackageInstalls"; - public static readonly string CommandExecutionTimeoutSeconds = "commandExecutionTimeoutSeconds"; public static readonly string Proxy = "proxy"; public static readonly string ProxyUser = "proxyUser"; public static readonly string ProxyPassword = "proxyPassword"; diff --git a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs index 644929f9d9..bf057b3c9c 100644 --- a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs +++ b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs @@ -194,21 +194,13 @@ private static void set_config_items(ChocolateyConfiguration config, ConfigFileS config.CacheLocation = fileSystem.combine_paths(ApplicationParameters.InstallLocation, "temp"); } - var originalCommandTimeout = configFileSettings.CommandExecutionTimeoutSeconds; - var commandExecutionTimeoutSeconds = -1; - int.TryParse( - set_config_item( - ApplicationParameters.ConfigSettings.CommandExecutionTimeoutSeconds, - configFileSettings, - originalCommandTimeout == 0 ? - ApplicationParameters.DefaultWaitForExitInSeconds.to_string() - : originalCommandTimeout.to_string(), - "Default timeout for command execution."), - out commandExecutionTimeoutSeconds); - config.CommandExecutionTimeoutSeconds = commandExecutionTimeoutSeconds; - if (configFileSettings.CommandExecutionTimeoutSeconds <= 0) + if (configFileSettings.CommandExecutionTimeoutSeconds > 0) + { + config.CommandExecutionTimeoutSeconds = configFileSettings.CommandExecutionTimeoutSeconds; + } + else { - set_config_item(ApplicationParameters.ConfigSettings.CommandExecutionTimeoutSeconds, configFileSettings, ApplicationParameters.DefaultWaitForExitInSeconds.to_string(), "Default timeout for command execution.", forceSettingValue: true); + set_config_item(ApplicationParameters.DefaultWaitForExitInSeconds.to_string(), configFileSettings, ApplicationParameters.DefaultWaitForExitInSeconds.to_string(), "Default timeout for command execution.", forceSettingValue: true); config.CommandExecutionTimeoutSeconds = ApplicationParameters.DefaultWaitForExitInSeconds; } diff --git a/src/chocolatey/infrastructure.app/configuration/chocolatey.config b/src/chocolatey/infrastructure.app/configuration/chocolatey.config index 2a4275993d..e6c7900498 100644 --- a/src/chocolatey/infrastructure.app/configuration/chocolatey.config +++ b/src/chocolatey/infrastructure.app/configuration/chocolatey.config @@ -3,7 +3,6 @@ -