public CloseBreakSearcher(IServiceScopeFactory serviceScopeFactory,
                           string userId, IConfiguration configuration,
                           ILogger logger, ArgCloseBreak arg) : base(serviceScopeFactory, userId, configuration)
 {
     _logger = logger;
     _arg    = arg;
 }
Beispiel #2
0
        public ActionResult ColseBreak([FromBody] ArgCloseBreak model)
        {
            var userId   = HttpContext.User.Identity.Name;
            var searcher = new CloseBreakSearcher(_serviceScopeFactory, userId, _configuration,
                                                  _logger, model);

            //开启新的线程来执行任务
            Task.Run(async() => await searcher.Search());
            return(NoContent());
        }