ExamPatriarchQuestionnaireProgressSyncJob.cs 849 B

12345678910111213141516171819
  1. using Furion.Schedule;
  2. using Microsoft.Extensions.DependencyInjection;
  3. //using Microsoft.Extensions.Logging;
  4. namespace YBEE.EQM.Application;
  5. /// <summary>
  6. /// 学生家长问卷填答进度同步作业
  7. /// </summary>
  8. //public class ExamPatriarchQuestionnaireProgressSyncJob(ILogger<ExamPatriarchQuestionnaireProgressSyncJob> logger, IServiceScopeFactory scopeFactory) : IJob
  9. public class ExamPatriarchQuestionnaireProgressSyncJob(IServiceScopeFactory scopeFactory) : IJob
  10. {
  11. public async Task ExecuteAsync(JobExecutingContext context, CancellationToken stoppingToken)
  12. {
  13. using var serviceScope = scopeFactory.CreateScope();
  14. var examPatriarchQuestionnaireProgressSync = serviceScope.ServiceProvider.GetService<IExamPatriarchQuestionnaireProgressSync>();
  15. await examPatriarchQuestionnaireProgressSync.Sync();
  16. }
  17. }