Browse Source

Increased maxRetryCount (number of retries) of EFDbContext trying to connect to the ASP.NET Identity database so EF migrations is run properly if the SQL container starts up slower.

pull/380/head
Cesar De la Torre 7 years ago
parent
commit
617bcdc8ec
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/Services/Identity/Identity.API/Startup.cs

+ 3
- 3
src/Services/Identity/Identity.API/Startup.cs View File

@ -42,7 +42,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
{
sqlOptions.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name);
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
sqlOptions.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
}));
services.AddIdentity<ApplicationUser, IdentityRole>()
@ -91,7 +91,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
{
sqlOptions.MigrationsAssembly(migrationsAssembly);
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
sqlOptions.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
});
})
.AddOperationalStore(options =>
@ -101,7 +101,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
{
sqlOptions.MigrationsAssembly(migrationsAssembly);
//Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
sqlOptions.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
});
})
.Services.AddTransient<IProfileService, ProfileService>();


Loading…
Cancel
Save