Skip to content

Commit 22b8ebb

Browse files
authored
dispose CancellationTokenSource after use (#49796)
Co-authored-by: aleksandr evdokimenko <aleksandr.evdokimenko>
1 parent 6a0dc64 commit 22b8ebb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Middleware/Spa/SpaServices.Extensions/src/AngularCli/AngularCliMiddleware.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ private static async Task WaitForAngularCliServerToAcceptRequests(Uri cliServerU
113113
try
114114
{
115115
// If we get any HTTP response, the CLI server is ready
116+
using var cancellationTokenSource = new CancellationTokenSource(timeoutMilliseconds);
116117
await client.SendAsync(
117118
new HttpRequestMessage(HttpMethod.Head, cliServerUri),
118-
new CancellationTokenSource(timeoutMilliseconds).Token);
119+
cancellationTokenSource.Token);
119120
return;
120121
}
121122
catch (Exception)

0 commit comments

Comments
 (0)