protected override async Task ExecuteAsync(CancellationToken cancellationToken) { await _webhookHandler.InvokeAsync( WebhookEvents.BackgroundServiceStarted, _healthCheckRepository.Get()); while (!cancellationToken.IsCancellationRequested) { await _webhookHandler.InvokeAsync( WebhookEvents.BackgroundServiceProcessing, _healthCheckRepository.Get()); await Task.Delay(TimeSpan.FromSeconds(30), cancellationToken); } }
public ActionResult Get() { return(Ok(_healthCheckRepository.Get())); }