Skip to content

Commit

Permalink
feat: or-2238 waitfor elastic on startup admin api
Browse files Browse the repository at this point in the history
  • Loading branch information
koenmetsu committed Jun 24, 2024
1 parent 13682ee commit 1e675a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

<ItemGroup>
<ProjectReference Include="..\AssociationRegistry.Admin.Schema\AssociationRegistry.Admin.Schema.csproj" />
<ProjectReference Include="..\AssociationRegistry.Hosts\AssociationRegistry.Hosts.csproj" />
<ProjectReference Include="..\AssociationRegistry.Magda\AssociationRegistry.Magda.csproj" />
<ProjectReference Include="..\AssociationRegistry.OpenTelemetry\AssociationRegistry.OpenTelemetry.csproj" />
<ProjectReference Include="..\AssociationRegistry\AssociationRegistry.csproj" />
Expand Down
6 changes: 6 additions & 0 deletions src/AssociationRegistry.Admin.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace AssociationRegistry.Admin.Api;
using Framework;
using Grar;
using GrarSync;
using Hosts;
using IdentityModel.AspNetCore.OAuth2Introspection;
using Infrastructure;
using Infrastructure.AWS;
Expand Down Expand Up @@ -49,6 +50,7 @@ namespace AssociationRegistry.Admin.Api;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using Nest;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
Expand Down Expand Up @@ -137,6 +139,10 @@ public static async Task Main(string[] args)

await RunPreStartupTasks(app, logger);

await WaitFor.ElasticSearchToBecomeAvailable(
app.Services.GetRequiredService<ElasticClient>(),
app.Services.GetRequiredService<ILogger<Program>>());

await app.RunOaktonCommands(args);
}

Expand Down

0 comments on commit 1e675a8

Please sign in to comment.