aboutsummaryrefslogtreecommitdiff
path: root/lib/Plugins.Essentials.ServiceStack/src/ServiceGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Plugins.Essentials.ServiceStack/src/ServiceGroup.cs')
-rw-r--r--lib/Plugins.Essentials.ServiceStack/src/ServiceGroup.cs17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Plugins.Essentials.ServiceStack/src/ServiceGroup.cs b/lib/Plugins.Essentials.ServiceStack/src/ServiceGroup.cs
index c8be44c..e504013 100644
--- a/lib/Plugins.Essentials.ServiceStack/src/ServiceGroup.cs
+++ b/lib/Plugins.Essentials.ServiceStack/src/ServiceGroup.cs
@@ -23,7 +23,6 @@
*/
using System.Net;
-using System.Linq;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
@@ -80,28 +79,28 @@ namespace VNLib.Plugins.Essentials.ServiceStack
_endpointsForPlugins.Clear();
}
- internal void OnPluginLoaded(IManagedPlugin controller)
+ internal void OnPluginLoaded(IManagedPlugin plugin)
{
//Get all new endpoints for plugin
- IEndpoint[] newEndpoints = controller.Controller.GetOnlyWebPlugins().SelectMany(static pl => pl.Plugin!.GetEndpoints()).ToArray();
+ IEndpoint[] newEndpoints = plugin.GetEndpoints();
//Add endpoints to dict
- _endpointsForPlugins.AddOrUpdate(controller, newEndpoints);
+ _endpointsForPlugins.AddOrUpdate(plugin, newEndpoints);
//Add endpoints to hosts
- _vHosts.TryForeach(v => v.OnRuntimeServiceAttach(controller, newEndpoints));
+ _vHosts.TryForeach(v => v.OnRuntimeServiceAttach(plugin, newEndpoints));
}
- internal void OnPluginUnloaded(IManagedPlugin controller)
+ internal void OnPluginUnloaded(IManagedPlugin plugin)
{
//Get the old endpoints from the controller referrence and remove them
- if (_endpointsForPlugins.TryGetValue(controller, out IEndpoint[]? oldEps))
+ if (_endpointsForPlugins.TryGetValue(plugin, out IEndpoint[]? oldEps))
{
//Remove the old endpoints
- _vHosts.TryForeach(v => v.OnRuntimeServiceDetach(controller, oldEps));
+ _vHosts.TryForeach(v => v.OnRuntimeServiceDetach(plugin, oldEps));
//remove controller ref
- _ = _endpointsForPlugins.Remove(controller);
+ _ = _endpointsForPlugins.Remove(plugin);
}
}
}