aboutsummaryrefslogtreecommitdiff
path: root/plugins/VNLib.Data.Caching.Providers.VNCache/src/VNCacheConfig.cs
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-06-21 17:07:01 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-06-21 17:07:01 -0400
commit2bfa3f2724ba762cf0b88de2d1acf119f5ce46c2 (patch)
treeacd03c866087b96fe0ed5c2b6a5a8a319d9dc9e6 /plugins/VNLib.Data.Caching.Providers.VNCache/src/VNCacheConfig.cs
parentb21ee53a99b30a21cecd1687ca337d713c919877 (diff)
latest server changes + better validation
Diffstat (limited to 'plugins/VNLib.Data.Caching.Providers.VNCache/src/VNCacheConfig.cs')
-rw-r--r--plugins/VNLib.Data.Caching.Providers.VNCache/src/VNCacheConfig.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/VNLib.Data.Caching.Providers.VNCache/src/VNCacheConfig.cs b/plugins/VNLib.Data.Caching.Providers.VNCache/src/VNCacheConfig.cs
index 24008b3..1911649 100644
--- a/plugins/VNLib.Data.Caching.Providers.VNCache/src/VNCacheConfig.cs
+++ b/plugins/VNLib.Data.Caching.Providers.VNCache/src/VNCacheConfig.cs
@@ -26,6 +26,7 @@ using System;
using System.Text.Json.Serialization;
using VNLib.Plugins.Extensions.Loading;
+using VNLib.Plugins.Extensions.Loading.Configuration;
namespace VNLib.Data.Caching.Providers.VNCache
{
@@ -91,12 +92,11 @@ namespace VNLib.Data.Caching.Providers.VNCache
[JsonPropertyName("max_object_size")]
public virtual uint MaxBlobSize { get; set; } = 16 * 1024;
- public virtual void Validate()
+ public virtual void OnValidate()
{
- if (MaxBlobSize < 16)
- {
- throw new ArgumentException("You must configure a maximum object size", "max_object_size");
- }
+
+ Validate.Range2<uint>(MaxBlobSize, 16, uint.MaxValue, "You must configure a maximum object size");
+
}
/// <summary>