Skip to content

Commit 0364a6a

Browse files
authored
Don't dispose of serviceBusClient
Don't dispose of serviceBusClient since it is out of the scope of this article.
1 parent 6809e05 commit 0364a6a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

articles/azure-app-configuration/enable-dynamic-configuration-dotnet-core-push-refresh.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ namespace TestConsole
118118
_refresher = options.GetRefresher();
119119
}).Build();
120120

121-
await using var serviceBusClient = await RegisterRefreshEventHandler();
121+
await RegisterRefreshEventHandler();
122122
var message = configuration["TestApp:Settings:Message"];
123123
Console.WriteLine($"Initial value: {configuration["TestApp:Settings:Message"]}");
124124

@@ -136,11 +136,11 @@ namespace TestConsole
136136
}
137137
}
138138

139-
private static async Task<IAsyncDisposable> RegisterRefreshEventHandler()
139+
private static async Task RegisterRefreshEventHandler()
140140
{
141141
string serviceBusConnectionString = Environment.GetEnvironmentVariable(ServiceBusConnectionStringEnvVarName);
142142
string serviceBusTopic = Environment.GetEnvironmentVariable(ServiceBusTopicEnvVarName);
143-
string serviceBusSubscription = Environment.GetEnvironmentVariable(ServiceBusSubscriptionEnvVarName);
143+
string serviceBusSubscription = Environment.GetEnvironmentVariable(ServiceBusSubscriptionEnvVarName);
144144
ServiceBusClient serviceBusClient = new ServiceBusClient(serviceBusConnectionString);
145145
ServiceBusProcessor serviceBusProcessor = serviceBusClient.CreateProcessor(serviceBusTopic, serviceBusSubscription);
146146

@@ -165,7 +165,6 @@ namespace TestConsole
165165
};
166166

167167
await serviceBusProcessor.StartProcessingAsync();
168-
return serviceBusClient;
169168
}
170169
}
171170
}

0 commit comments

Comments
 (0)