Browse Source

modify retries count

features/migration-dotnet3
Erik Pique 5 years ago
parent
commit
79405b89b0
25 changed files with 50 additions and 48 deletions
  1. +1
    -0
      global.json
  2. +1
    -0
      src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj
  3. +1
    -1
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj
  4. +1
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
  5. +1
    -1
      src/Services/Basket/Basket.API/Basket.API.csproj
  6. +2
    -1
      src/Services/Catalog/Catalog.API/Catalog.API.csproj
  7. +4
    -3
      src/Services/Catalog/Catalog.API/Startup.cs
  8. +2
    -0
      src/Services/Identity/Identity.API/Identity.API.csproj
  9. +0
    -4
      src/Services/Identity/Identity.API/Startup.cs
  10. +1
    -0
      src/Services/Location/Locations.API/Locations.API.csproj
  11. +14
    -9
      src/Services/Marketing/Marketing.API/Infrastructure/Filters/AuthorizeCheckOperationFilter.cs
  12. +2
    -1
      src/Services/Marketing/Marketing.API/Marketing.API.csproj
  13. +3
    -2
      src/Services/Marketing/Marketing.API/Startup.cs
  14. +2
    -1
      src/Services/Ordering/Ordering.API/Ordering.API.csproj
  15. +2
    -14
      src/Services/Ordering/Ordering.API/Startup.cs
  16. +2
    -0
      src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj
  17. +1
    -1
      src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj
  18. +1
    -0
      src/Services/Payment/Payment.API/Payment.API.csproj
  19. +3
    -2
      src/Services/Webhooks/Webhooks.API/Startup.cs
  20. +1
    -1
      src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj
  21. +1
    -1
      src/Web/WebMVC/WebMVC.csproj
  22. +1
    -1
      src/Web/WebSPA/WebSPA.csproj
  23. +1
    -2
      src/Web/WebStatus/Startup.cs
  24. +1
    -1
      src/Web/WebStatus/WebStatus.csproj
  25. +1
    -1
      src/Web/WebhookClient/WebhookClient.csproj

+ 1
- 0
global.json View File

@ -0,0 +1 @@
{}

+ 1
- 0
src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj View File

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


+ 1
- 1
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj View File

@ -6,7 +6,7 @@
<RootNamespace>Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator</RootNamespace>
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>8.0</LangVersion>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


+ 1
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj View File

@ -6,7 +6,7 @@
<RootNamespace>Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator</RootNamespace>
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>8.0</LangVersion>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


+ 1
- 1
src/Services/Basket/Basket.API/Basket.API.csproj View File

@ -5,7 +5,7 @@
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>8.0</LangVersion>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


+ 2
- 1
src/Services/Catalog/Catalog.API/Catalog.API.csproj View File

@ -8,7 +8,8 @@
<PackageId>Catalog.API</PackageId>
<UserSecretsId>aspnet-Catalog.API-20161122013618</UserSecretsId>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<LangVersion>8.0</LangVersion>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>


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

@ -202,14 +202,15 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
public static IServiceCollection AddCustomDbContext(this IServiceCollection services, IConfiguration configuration)
{
services.AddDbContext<CatalogContext>(options =>
services.AddEntityFrameworkSqlServer()
.AddDbContext<CatalogContext>(options =>
{
options.UseSqlServer(configuration["ConnectionString"],
sqlServerOptionsAction: sqlOptions =>
{
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);
});
// Changing default behavior when client evaluation occurs to throw.
@ -225,7 +226,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.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);
});
});


+ 2
- 0
src/Services/Identity/Identity.API/Identity.API.csproj View File

@ -4,6 +4,8 @@
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<UserSecretsId>aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5</UserSecretsId>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


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

@ -7,7 +7,6 @@ using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopOnContainers.Services.Identity.API.Certificates;
using Microsoft.eShopOnContainers.Services.Identity.API.Data;
@ -54,9 +53,6 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
services.Configure<AppSettings>(Configuration);
services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
if (Configuration.GetValue<string>("IsClusterEnv") == bool.TrueString)
{
services.AddDataProtection(opts =>


+ 1
- 0
src/Services/Location/Locations.API/Locations.API.csproj View File

@ -4,6 +4,7 @@
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<UserSecretsId>aspnet-Locations.API-20161122013619</UserSecretsId>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


+ 14
- 9
src/Services/Marketing/Marketing.API/Infrastructure/Filters/AuthorizeCheckOperationFilter.cs View File

@ -1,5 +1,5 @@
using Microsoft.AspNetCore.Authorization;
using Swashbuckle.AspNetCore.Swagger;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Collections.Generic;
using System.Linq;
@ -8,7 +8,7 @@ namespace Microsoft.eShopOnContainers.Services.Marketing.API.Infrastructure.Filt
{
public class AuthorizeCheckOperationFilter : IOperationFilter
{
public void Apply(Operation operation, OperationFilterContext context)
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
// Check for authorize attribute
var hasAuthorize = context.MethodInfo.DeclaringType.GetCustomAttributes(true).OfType<AuthorizeAttribute>().Any() ||
@ -16,16 +16,21 @@ namespace Microsoft.eShopOnContainers.Services.Marketing.API.Infrastructure.Filt
if (!hasAuthorize) return;
operation.Responses.TryAdd("401", new Response { Description = "Unauthorized" });
operation.Responses.TryAdd("403", new Response { Description = "Forbidden" });
operation.Responses.TryAdd("401", new OpenApiResponse { Description = "Unauthorized" });
operation.Responses.TryAdd("403", new OpenApiResponse { Description = "Forbidden" });
operation.Security = new List<IDictionary<string, IEnumerable<string>>>
var oAuthScheme = new OpenApiSecurityScheme
{
new Dictionary<string, IEnumerable<string>>
{
{ "oauth2", new [] { "marketingapi" } }
}
Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "oauth2" }
};
operation.Security = new List<OpenApiSecurityRequirement>
{
new OpenApiSecurityRequirement
{
[ oAuthScheme ] = new [] { "marketingapi" }
}
};
}
}
}

+ 2
- 1
src/Services/Marketing/Marketing.API/Marketing.API.csproj View File

@ -5,11 +5,12 @@
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<RootNamespace>Microsoft.eShopOnContainers.Services.Marketing.API</RootNamespace>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<UserSecretsId>aspnet-Marketing.API-20161122013619</UserSecretsId>
<AssemblyName />
<ApplicationInsightsResourceId>/subscriptions/6c22bb55-0221-4ce4-9bf1-3c4a10a7294c/resourcegroups/eshop-log/providers/microsoft.insights/components/eshopappinsights</ApplicationInsightsResourceId>
<ApplicationInsightsAnnotationResourceId>/subscriptions/6c22bb55-0221-4ce4-9bf1-3c4a10a7294c/resourcegroups/eshop-log/providers/microsoft.insights/components/eshopappinsights</ApplicationInsightsAnnotationResourceId>
<LangVersion>8.0</LangVersion>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


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

@ -62,14 +62,15 @@
ConfigureAuthService(services);
services.AddDbContext<MarketingContext>(options =>
services.AddEntityFrameworkSqlServer()
.AddDbContext<MarketingContext>(options =>
{
options.UseSqlServer(Configuration["ConnectionString"],
sqlServerOptionsAction: sqlOptions =>
{
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);
});
// Changing default behavior when client evaluation occurs to throw.


+ 2
- 1
src/Services/Ordering/Ordering.API/Ordering.API.csproj View File

@ -5,7 +5,8 @@
<UserSecretsId>aspnet-Ordering.API-20161122013547</UserSecretsId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<LangVersion>8.0</LangVersion>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


+ 2
- 14
src/Services/Ordering/Ordering.API/Startup.cs View File

@ -13,7 +13,6 @@
using Infrastructure.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.ServiceBus;
using Microsoft.EntityFrameworkCore;
@ -82,17 +81,6 @@
app.UseCors("CorsPolicy");
app.UseHealthChecks("/liveness", new HealthCheckOptions
{
Predicate = r => r.Name.Contains("self")
});
app.UseHealthChecks("/hc", new HealthCheckOptions()
{
Predicate = _ => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
ConfigureAuth(app);
app.UseRouting();
@ -221,7 +209,7 @@
sqlServerOptionsAction: sqlOptions =>
{
sqlOptions.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name);
sqlOptions.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
});
},
ServiceLifetime.Scoped //Showing explicitly that the DbContext is shared across the HTTP request scope (graph of objects started in the HTTP request)
@ -234,7 +222,7 @@
{
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);
});
});


+ 2
- 0
src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj View File

@ -4,6 +4,8 @@
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


+ 1
- 1
src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj View File

@ -4,7 +4,7 @@
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>8.0</LangVersion>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>


+ 1
- 0
src/Services/Payment/Payment.API/Payment.API.csproj View File

@ -4,6 +4,7 @@
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>


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

@ -164,14 +164,15 @@ namespace Webhooks.API
public static IServiceCollection AddCustomDbContext(this IServiceCollection services, IConfiguration configuration)
{
services.AddDbContext<WebhooksContext>(options =>
services.AddEntityFrameworkSqlServer()
.AddDbContext<WebhooksContext>(options =>
{
options.UseSqlServer(configuration["ConnectionString"],
sqlServerOptionsAction: sqlOptions =>
{
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);
});
// Changing default behavior when client evaluation occurs to throw.


+ 1
- 1
src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj View File

@ -6,7 +6,7 @@
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>8.0</LangVersion>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


+ 1
- 1
src/Web/WebMVC/WebMVC.csproj View File

@ -6,7 +6,7 @@
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<TypeScriptToolsVersion>3.0</TypeScriptToolsVersion>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>8.0</LangVersion>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


+ 1
- 1
src/Web/WebSPA/WebSPA.csproj View File

@ -9,7 +9,7 @@
<GeneratedItemPatterns>wwwroot/dist/**</GeneratedItemPatterns>
<DefaultItemExcludes>$(DefaultItemExcludes);$(GeneratedItemPatterns)</DefaultItemExcludes>
<TypeScriptToolsVersion>2.9</TypeScriptToolsVersion>
<LangVersion>8.0</LangVersion>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>


+ 1
- 2
src/Web/WebStatus/Startup.cs View File

@ -28,7 +28,6 @@ namespace WebStatus
.AddCheck("self", () => HealthCheckResult.Healthy());
services.AddHealthChecksUI();
services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
}
@ -65,7 +64,7 @@ namespace WebStatus
app.UseStaticFiles();
app.UseHttpsRedirection();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");


+ 1
- 1
src/Web/WebStatus/WebStatus.csproj View File

@ -3,7 +3,7 @@
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<LangVersion>8.0</LangVersion>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="$(AspNetCore_HealthChecks_UI)" />


+ 1
- 1
src/Web/WebhookClient/WebhookClient.csproj View File

@ -7,7 +7,7 @@
<UserSecretsId>36215d41-f31a-4aa6-9929-bd67d650e7b5</UserSecretsId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<LangVersion>8.0</LangVersion>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>


Loading…
Cancel
Save