From 93c096ac2dae1ec207ec21b331058910faab47a7 Mon Sep 17 00:00:00 2001 From: Paul Volavsek Date: Fri, 16 Feb 2024 09:53:28 +0100 Subject: [PATCH] Revert "Host ipos of helper if available" This reverts commit 1967a923553b780b667ba53f58a4f01d754a7b54. --- .../ProcessHost/ProcessHostPlebeian.cs | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/fiskaltrust.Launcher/ProcessHost/ProcessHostPlebeian.cs b/src/fiskaltrust.Launcher/ProcessHost/ProcessHostPlebeian.cs index 15742ead..23191ac2 100644 --- a/src/fiskaltrust.Launcher/ProcessHost/ProcessHostPlebeian.cs +++ b/src/fiskaltrust.Launcher/ProcessHost/ProcessHostPlebeian.cs @@ -126,7 +126,6 @@ private async Task StartHosting(string[] uris) _ => throw new NotImplementedException() }; - var helperIPOS = GetHelper(_services); foreach (var uri in uris) { @@ -137,6 +136,12 @@ private async Task StartHosting(string[] uris) continue; } + Action? addEndpointsInner = hostingType switch + { + HostingType.REST => addEndpoints, + _ => null + }; + try { switch (_plebeianConfiguration.PackageType) @@ -155,10 +160,7 @@ private async Task StartHosting(string[] uris) await _hosting.HostService(url, hostingType.Value, (IPOS)instance, addEndpoints); break; case PackageType.Helper: - if (helperIPOS is not null) - { - await _hosting.HostService(url, hostingType.Value, helperIPOS.Value.instance, helperIPOS.Value.addEndpoints); - } + await _hosting.HostService(url, hostingType.Value, (IHelper)instance, addEndpoints); break; default: throw new NotImplementedException(); @@ -178,18 +180,6 @@ private async Task StartHosting(string[] uris) } } - private static (IPOS instance, Action addEndpoints)? GetHelper(IServiceProvider services) - { - var queue = services.GetService(); - - if (queue is not null) - { - return (queue, (WebApplication app) => app.AddQueueEndpoints(queue)); - } - - return null; - } - private static (object, Action, Type) GetQueue(IServiceProvider services) { var queue = services.GetRequiredService();