Skip to content

Commit

Permalink
Try fix corrupt index
Browse files Browse the repository at this point in the history
  • Loading branch information
steinho committed Aug 12, 2024
1 parent 87b5b3f commit 9656bb6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Prod.Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,17 @@ private void StartupAddDependencies(IServiceCollection services)
//}

services.AddDbContext<ProdDbContext>(opt => opt.UseSqlServer(connectionString));
services.AddSingleton(new Index());
Index implementationInstance;
try
{
implementationInstance = new Index();
}
catch (Exception e)
{
implementationInstance = new Index(false, true);
throw;
}
services.AddSingleton(implementationInstance);
var options = new ReferenceServiceOptions()
{
AuthAuthority = Configuration.GetValue("AuthAuthority", "https://demo.identityserver.io"),
Expand Down

0 comments on commit 9656bb6

Please sign in to comment.