Skip to content

Commit 8e7f9f5

Browse files
authored
Suppress warning on CS4014 (#10229)
These are fire and forget tasks performed during app shutdown
1 parent 6211dfb commit 8e7f9f5

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/NuGetGallery/App_Start/DefaultDependenciesModule.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ protected override void Load(ContainerBuilder builder)
381381
builder.RegisterType<MarkdownService>()
382382
.As<IMarkdownService>()
383383
.InstancePerLifetimeScope();
384-
384+
385385
builder.RegisterType<ImageDomainValidator>()
386386
.As<IImageDomainValidator>()
387387
.InstancePerLifetimeScope();
@@ -405,7 +405,7 @@ protected override void Load(ContainerBuilder builder)
405405
.AsSelf()
406406
.As<ICertificateService>()
407407
.InstancePerLifetimeScope();
408-
408+
409409
RegisterTyposquattingServiceHelper(builder, loggerFactory);
410410

411411
builder.RegisterType<TyposquattingService>()
@@ -812,7 +812,9 @@ private static void RegisterSwitchingDeleteAccountService(ContainerBuilder build
812812
.Register(c => new TopicClientWrapper(asyncAccountDeleteConnectionString, asyncAccountDeleteTopicName, configuration.ServiceBus.ManagedIdentityClientId))
813813
.SingleInstance()
814814
.Keyed<ITopicClient>(BindingKeys.AccountDeleterTopic)
815+
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
815816
.OnRelease(x => x.CloseAsync());
817+
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
816818

817819
builder
818820
.RegisterType<AsynchronousDeleteAccountService>()
@@ -948,7 +950,9 @@ private static void RegisterAsynchronousEmailMessagingService(ContainerBuilder b
948950
.As<ITopicClient>()
949951
.SingleInstance()
950952
.Keyed<ITopicClient>(BindingKeys.EmailPublisherTopic)
953+
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
951954
.OnRelease(x => x.CloseAsync());
955+
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
952956

953957
builder
954958
.RegisterType<EmailMessageEnqueuer>()
@@ -1103,14 +1107,18 @@ private void RegisterAsynchronousValidation(
11031107
.As<ITopicClient>()
11041108
.SingleInstance()
11051109
.Keyed<ITopicClient>(BindingKeys.PackageValidationTopic)
1110+
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
11061111
.OnRelease(x => x.CloseAsync());
1112+
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
11071113

11081114
builder
11091115
.Register(c => new TopicClientWrapper(symbolsValidationConnectionString, symbolsValidationTopicName, configuration.ServiceBus.ManagedIdentityClientId))
11101116
.As<ITopicClient>()
11111117
.SingleInstance()
11121118
.Keyed<ITopicClient>(BindingKeys.SymbolsPackageValidationTopic)
1119+
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
11131120
.OnRelease(x => x.CloseAsync());
1121+
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
11141122
}
11151123
else
11161124
{

0 commit comments

Comments
 (0)