Пример #1
0
        public void CancelBusyProcesses()
        {
            var busyProcesses = processQuery.GetAll(true);

            foreach (var process in busyProcesses)
            {
                if (process.Type == (int)ProcessTypeEnum.PrcIndex)
                {
                    var serviceId = process.AffectedObjectId?.ToString();
                    var service   = serviceQuery.Get(serviceId);
                    if (service == null)
                    {
                        logger.LogError($"Cannot find Service {serviceId} of the interrupted process {process.Id}");
                        continue;
                    }

                    prcIndexServiceHandler.CleanPrcIndex(serviceId);
                }

                processHandler.Interrupted(process.Id, new SlambyException(Resources.ProcessResources.UnexpectedInterruptionError));
            }
        }
        public IActionResult Get([FromQuery] bool allStatus = false, [FromQuery] bool allTime = false)
        {
            var processes = processQuery.GetAll(!allStatus, allTime ? 0 : 30);

            return(new OkObjectResult(processes.Select(ModelHelper.ToProcessModel)));
        }