Exemplo n.º 1
0
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            while (!stoppingToken.IsCancellationRequested)
            {
                _logger.LogInformation($"Worker execution started at: {DateTimeOffset.Now}");

                await _trade.Operation();

                _logger.LogInformation($"Worker execution finished at: {DateTimeOffset.Now}");

                await Task.Delay(_workerSettings.IntervalInMilliseconds, stoppingToken);
            }
        }