Changed NuCache settings to use a nullable integer.

This commit is contained in:
Andy Butland
2020-09-18 12:54:17 +02:00
parent 41c7f6989a
commit bae4f2fb53
2 changed files with 3 additions and 4 deletions

View File

@@ -45,11 +45,10 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
var blockSize = 4096;
var appSetting = settings.BTreeBlockSize;
if (appSetting == null)
if (!appSetting.HasValue)
return blockSize;
if (!int.TryParse(appSetting, out blockSize))
throw new ConfigurationErrorsException($"Invalid block size value \"{appSetting}\": not a number.");
blockSize = appSetting.Value;
var bit = 0;
for (var i = blockSize; i != 1; i >>= 1)