Exemplo n.º 1
0
 protected override async Task ExecuteAsync(CancellationToken stoppingToken)
 {
     while (!stoppingToken.IsCancellationRequested)
     {
         _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
         var services = _remoteService.GetServices();
         foreach (var call in _remoteServiceCall.GetServiceCalls())
         {
             MoniterServices(services, call);
             await Task.Delay(call.Frequency, stoppingToken);
         }
     }
 }