public STAAriseSearcher(IServiceScopeFactory serviceScopeFactory, string userId, IConfiguration configuration, ILogger logger, ArgSTA arg) : base(serviceScopeFactory, userId, configuration) { _logger = logger; _arg = arg; this._actionName = null;//action name是null 就不会用缓存 }
public ActionResult STAArise([FromBody] ArgSTA model) { var userId = HttpContext.User.Identity.Name; var searcher = new STAAriseSearcher(_serviceScopeFactory, userId, _configuration, _logger, model); //开启新的线程来执行任务 Task.Run(async() => await searcher.Search()); return(NoContent()); }