Skip to content

Commit

Permalink
Improved orchestrator w.r.t. discovery service
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRappl committed Feb 15, 2024
1 parent c73eb41 commit 427b424
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public MfDiscoveryLoaderService(IHttpClientFactory client, IMfRepository reposit
_repository = repository;
_snapshot = snapshot;
_package = package;
_feedUrl = configuration.GetValue<string>("Microfrontends:DiscoveryInfoUrl") ?? "https://feed.piral.cloud/api/v1/pilet/empty";
_feedUrl = configuration.GetValue<string>("Microfrontends:DiscoveryInfoUrl") ?? "https://feed.piral.cloud/api/v1/microfrontends/empty";
_wsUrl = configuration.GetValue<string>("Microfrontends:DiscoveryUpdateUrl") ?? "wss://feed.piral.cloud/api/v1/pilet/empty";

repository.PackagesChanged += OnPackagesChanged;
Expand Down Expand Up @@ -51,7 +51,8 @@ public async Task LoadMicrofrontends(CancellationToken cancellationToken)

if (version is not null)
{
var mf = await _package.LoadMicrofrontend(item.Key, version);
var name = data?.Extras?.Id ?? item.Key;
var mf = await _package.LoadMicrofrontend(name, version);
await _repository.SetPackage(mf);
}
}
Expand All @@ -75,7 +76,7 @@ public async void ConnectMicrofrontends(CancellationToken ct)
// Ignore such errors for now - just reconnect as long as
// the service is running
// We wait a second to give the server a chance to recover
await Task.Delay(1000).ConfigureAwait(false);
await Task.Delay(1000, ct).ConfigureAwait(false);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,18 @@ internal class MfDiscoveryServiceItemExtras
public List<string>? Assemblies { get; set; }

public Dictionary<string, string>? Dependencies { get; set; }

public string? Id { get; set; }

public string? Title { get; set; }

public string? Summary { get; set; }

public string? PojectUrl { get; set; }

public string? LicenseUrl { get; set; }

public string? Framework { get; set; }

public MfDiscoveryServiceItemExtrasPilet? Pilet { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Piral.Blazor.Orchestrator.Loader;

internal class MfDiscoveryServiceItemExtrasPilet
{
public string? Spec { get; set; }
}

0 comments on commit 427b424

Please sign in to comment.