Skip to content

Commit

Permalink
Revert "Host ipos of helper if available"
Browse files Browse the repository at this point in the history
This reverts commit 1967a92.
  • Loading branch information
volllly committed Feb 16, 2024
1 parent 1967a92 commit 93c096a
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions src/fiskaltrust.Launcher/ProcessHost/ProcessHostPlebeian.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ private async Task StartHosting(string[] uris)
_ => throw new NotImplementedException()
};

var helperIPOS = GetHelper(_services);

foreach (var uri in uris)
{
Expand All @@ -137,6 +136,12 @@ private async Task StartHosting(string[] uris)
continue;
}

Action<WebApplication>? addEndpointsInner = hostingType switch
{
HostingType.REST => addEndpoints,
_ => null
};

try
{
switch (_plebeianConfiguration.PackageType)
Expand All @@ -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();
Expand All @@ -178,18 +180,6 @@ private async Task StartHosting(string[] uris)
}
}

private static (IPOS instance, Action<WebApplication> addEndpoints)? GetHelper(IServiceProvider services)
{
var queue = services.GetService<IPOS>();

if (queue is not null)
{
return (queue, (WebApplication app) => app.AddQueueEndpoints(queue));
}

return null;
}

private static (object, Action<WebApplication>, Type) GetQueue(IServiceProvider services)
{
var queue = services.GetRequiredService<IPOS>();
Expand Down

0 comments on commit 93c096a

Please sign in to comment.