From 2bfa3f2724ba762cf0b88de2d1acf119f5ce46c2 Mon Sep 17 00:00:00 2001 From: vnugent Date: Fri, 21 Jun 2024 17:07:01 -0400 Subject: latest server changes + better validation --- .../VNLib.Data.Caching.Providers.VNCache/src/VNCacheConfig.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/VNLib.Data.Caching.Providers.VNCache/src/VNCacheConfig.cs') 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(MaxBlobSize, 16, uint.MaxValue, "You must configure a maximum object size"); + } /// -- cgit