From 54353f8b6c2cce5d48e43d82d481c91b92c5a418 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 31 Jan 2023 11:20:21 -0500 Subject: [PATCH] HeartbeatHostedService use cancel token (#2654) --- src/Notifications/HeartbeatHostedService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Notifications/HeartbeatHostedService.cs b/src/Notifications/HeartbeatHostedService.cs index f635fa5bca..6dcfe7189f 100644 --- a/src/Notifications/HeartbeatHostedService.cs +++ b/src/Notifications/HeartbeatHostedService.cs @@ -49,7 +49,7 @@ public class HeartbeatHostedService : IHostedService, IDisposable while (!cancellationToken.IsCancellationRequested) { await _hubContext.Clients.All.SendAsync("Heartbeat"); - await Task.Delay(120000); + await Task.Delay(120000, cancellationToken); } _logger.LogWarning("Done with heartbeat."); }