diff options
Diffstat (limited to 'plugins/CacheBroker/src')
-rw-r--r-- | plugins/CacheBroker/src/CacheBroker.csproj | 26 | ||||
-rw-r--r-- | plugins/CacheBroker/src/Endpoints/BrokerRegistrationEndpoint.cs | 13 |
2 files changed, 17 insertions, 22 deletions
diff --git a/plugins/CacheBroker/src/CacheBroker.csproj b/plugins/CacheBroker/src/CacheBroker.csproj index 285d797..fa28dce 100644 --- a/plugins/CacheBroker/src/CacheBroker.csproj +++ b/plugins/CacheBroker/src/CacheBroker.csproj @@ -2,21 +2,15 @@ <PropertyGroup> <TargetFramework>net6.0</TargetFramework> - <Copyright>Copyright © 2023 Vaughn Nugent</Copyright> <RootNamespace>VNLib.Plugins.Cache.Broker</RootNamespace> - <Authors>Vaughn Nugent</Authors> <Version>1.0.1.2</Version> + <GenerateDocumentationFile>True</GenerateDocumentationFile> + <AnalysisLevel>latest-all</AnalysisLevel> <SignAssembly>True</SignAssembly> <AssemblyOriginatorKeyFile>\\vaughnnugent.com\Internal\Folder Redirection\vman\Documents\Programming\Software\StrongNameingKey.snk</AssemblyOriginatorKeyFile> </PropertyGroup> <ItemGroup> - <Compile Remove="liveplugin\**" /> - <EmbeddedResource Remove="liveplugin\**" /> - <None Remove="liveplugin\**" /> - </ItemGroup> - - <ItemGroup> <PackageReference Include="ErrorProne.NET.CoreAnalyzers" Version="0.1.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> @@ -26,14 +20,13 @@ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> </ItemGroup> - + <PropertyGroup> <!--Enable dynamic loading--> <EnableDynamicLoading>true</EnableDynamicLoading> - <GenerateDocumentationFile>True</GenerateDocumentationFile> + <Authors>Vaughn Nugent</Authors> + <Copyright>Copyright © 2023 Vaughn Nugent</Copyright> <PackageProjectUrl>https://www.vaughnnugent.com/resources/software</PackageProjectUrl> - <AnalysisLevel>latest-all</AnalysisLevel> - </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> @@ -50,12 +43,5 @@ <ProjectReference Include="..\..\..\..\..\core\lib\Utils\src\VNLib.Utils.csproj" /> <ProjectReference Include="..\..\..\..\Extensions\lib\VNLib.Plugins.Extensions.Loading\src\VNLib.Plugins.Extensions.Loading.csproj" /> </ItemGroup> - - - <ItemGroup> - <None Update="CacheBroker.json"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - </ItemGroup> - + </Project> diff --git a/plugins/CacheBroker/src/Endpoints/BrokerRegistrationEndpoint.cs b/plugins/CacheBroker/src/Endpoints/BrokerRegistrationEndpoint.cs index c2e0b84..8f983ac 100644 --- a/plugins/CacheBroker/src/Endpoints/BrokerRegistrationEndpoint.cs +++ b/plugins/CacheBroker/src/Endpoints/BrokerRegistrationEndpoint.cs @@ -56,11 +56,12 @@ using VNLib.Net.Rest.Client; namespace VNLib.Plugins.Cache.Broker.Endpoints { [ConfigurationName("broker_endpoint")] - public sealed class BrokerRegistrationEndpoint : ResourceEndpointBase + public sealed class BrokerRegistrationEndpoint : ResourceEndpointBase, IDisposable { const string HEARTBEAT_PATH = "/heartbeat"; - private static readonly RestClientPool ClientPool = new(10,new RestClientOptions() + //Client pool is instance based and may be disposed when the plugin is unloaded + private readonly RestClientPool ClientPool = new(10,new RestClientOptions() { Encoding = Encoding.UTF8, FollowRedirects = false, @@ -69,6 +70,7 @@ namespace VNLib.Plugins.Cache.Broker.Endpoints }, null); + //Matches the json schema set by the FBM caching extensions library private class ActiveServer { [JsonIgnore] @@ -408,5 +410,12 @@ namespace VNLib.Plugins.Cache.Broker.Endpoints _ = ActiveServers.Remove(server.ServerId!); } } + + + void IDisposable.Dispose() + { + //Cleanup client pool when exiting + ClientPool.Dispose(); + } } } |