Skip to content

Commit 35a31df

Browse files
author
aleksandr evdokimenko
committed
dispose CancellationTokenSource
1 parent 4a4d163 commit 35a31df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ private static async Task WaitForAngularCliServerToAcceptRequests(Uri cliServerU
113113
{
114114
try
115115
{
116+
using var cts = new CancellationTokenSource(timeoutMilliseconds);
116117
// If we get any HTTP response, the CLI server is ready
117118
await client.SendAsync(
118119
new HttpRequestMessage(HttpMethod.Head, cliServerUri),
119-
new CancellationTokenSource(timeoutMilliseconds).Token);
120-
return;
120+
cts.Token);
121121
}
122122
catch (Exception)
123123
{

0 commit comments

Comments
 (0)