public UpwardGapSearcher(IServiceScopeFactory serviceScopeFactory, string userId, IConfiguration configuration, ILogger logger, ArgUpwardGap arg) : base(serviceScopeFactory, userId, configuration) { _logger = logger; _arg = arg; }
public ActionResult UpwardGap([FromBody] ArgUpwardGap model) { var userId = HttpContext.User.Identity.Name; var flag = HttpContext.User.IsInRole("admin"); var searcher = new UpwardGapSearcher(_serviceScopeFactory, userId, _configuration, _logger, model); //开启新的线程来执行任务 Task.Run(async() => await searcher.Search()); return(NoContent()); }