protected override async Task ExecuteAsync(CancellationToken stoppingToken) { _logger.LogInformation("CleanArchitecture.Worker service starting at: {time}", DateTimeOffset.Now); while (!stoppingToken.IsCancellationRequested) { await _entryPointService.ExecuteAsync(); await Task.Delay(_settings.DelayMilliseconds, stoppingToken); } _logger.LogInformation("CleanArchitecture.Worker service stopping at: {time}", DateTimeOffset.Now); }
protected override async Task ExecuteAsync(CancellationToken stoppingToken) { _logger.LogInformation("UpdateService.Worker service starting at: {time}", DateTimeOffset.Now); while (!stoppingToken.IsCancellationRequested) { await _entryPointService.ExecuteAsync(); await Task.Delay(1000, stoppingToken); // TODO: Move delay to appSettings } _logger.LogInformation("UpdateService.Worker service stopping at: {time}", DateTimeOffset.Now); }