From d556e4a9eac8b5bfe507d4f4b6f3089828f411e7 Mon Sep 17 00:00:00 2001 From: Rafsanul Hasan Date: Thu, 4 Apr 2019 15:47:41 +0600 Subject: [PATCH] fix blank async lambda/functions to await Task.Run(()=>{}) --- src/ApiGateways/ApiGw-Base/Startup.cs | 7 ++++--- src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs | 3 +++ src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs | 5 +++-- .../ProductPriceChangedIntegrationEventHandler.cs | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/ApiGateways/ApiGw-Base/Startup.cs b/src/ApiGateways/ApiGw-Base/Startup.cs index 585c26471..1b4ec7b1d 100644 --- a/src/ApiGateways/ApiGw-Base/Startup.cs +++ b/src/ApiGateways/ApiGw-Base/Startup.cs @@ -9,6 +9,7 @@ using Ocelot.Middleware; using System; using HealthChecks.UI.Client; using Microsoft.Extensions.Diagnostics.HealthChecks; +using System.Threading.Tasks; namespace OcelotApiGw { @@ -59,16 +60,16 @@ namespace OcelotApiGw { OnAuthenticationFailed = async ctx => { - int i = 0; + await Task.Run(() => { }); }, OnTokenValidated = async ctx => { - int i = 0; + await Task.Run(() => { }); }, OnMessageReceived = async ctx => { - int i = 0; + await Task.Run(() => { }); } }; }); diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs index 924b5b1aa..c618b85df 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs @@ -20,6 +20,7 @@ using Swashbuckle.AspNetCore.Swagger; using HealthChecks.UI.Client; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.Extensions.Diagnostics.HealthChecks; +using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator { @@ -168,9 +169,11 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator { OnAuthenticationFailed = async ctx => { + await Task.Run(() => { }); }, OnTokenValidated = async ctx => { + await Task.Run(() => { }); } }; }); diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs index 6d3da29b7..49f8753d0 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs @@ -21,6 +21,7 @@ using System.Net.Http; using HealthChecks.UI.Client; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.Extensions.Diagnostics.HealthChecks; +using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator { @@ -117,11 +118,11 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator { OnAuthenticationFailed = async ctx => { - int i = 0; + await Task.Run(() => { }); }, OnTokenValidated = async ctx => { - int i = 0; + await Task.Run(() => { }); } }; }); diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEventHandler.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEventHandler.cs index 10e1542c8..e3a188918 100644 --- a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEventHandler.cs +++ b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEventHandler.cs @@ -10,7 +10,7 @@ namespace Webhooks.API.IntegrationEvents { public async Task Handle(ProductPriceChangedIntegrationEvent @event) { - int i = 0; + await Task.Run(() => { }); } } }