Esempio n. 1
0
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            while (!stoppingToken.IsCancellationRequested)
            {
                _logger.LogInformation("Worker started to run at: {time}", DateTimeOffset.Now);

                int minutos = int.Parse(_configuration.GetSection("Tempo").Value);

                await _businessService.DataProcess();

                _logger.LogInformation("Worker finished to run at: {time}", DateTimeOffset.Now);

                await Task.Delay(1000 * 60 *minutos, stoppingToken);
            }
        }