private const int TEMPS = 10000; // A modifier en fonction de la durée souhaitée private static void rebours(Object source, ElapsedEventArgs e) { ClotureLogic service = new ClotureLogic(); service.clotureFicheFrais(); service.miseEnRemboursement(); }
protected override async Task ExecuteAsync(CancellationToken stoppingToken) { while (!stoppingToken.IsCancellationRequested) { ClotureLogic service = new ClotureLogic(); service.clotureFicheFrais(); service.miseEnRemboursement(); _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now); await Task.Delay(JOURNEE, stoppingToken); } }