示例#1
0
        ///<summary>
        ///Obtiene las tareas programadas de un repositorio
        ///</summary>
        ///<param name="repositoryID">Identificador del repositorio</param>
        ///<returns>Lista de tareas programadas</returns>
        public List <ScheduledJobViewModel> GetScheduledJobs(Guid repositoryID)
        {
            List <ScheduledJobViewModel> scheduledJobs = new List <ScheduledJobViewModel>();
            List <string> jobsId = _context.JobRepository.Where(item => item.IdRepository.Equals(repositoryID) && item.FechaEjecucion > DateTime.Now).Select(item => item.IdJob).ToList();

            foreach (string idJob in jobsId)
            {
                string idScheduled = idJob;
                if (idScheduled.Contains("_"))
                {
                    idScheduled = idScheduled.Split("_")[0];
                }
                scheduledJobs.Add(_cronApiService.GetScheduledJobs(0, 200).First(item => item.Key.Equals(idScheduled)));
            }
            return(scheduledJobs);
        }
示例#2
0
 public IActionResult GetScheduledJobs(int from, int count)
 {
     return(Ok(_cronApiService.GetScheduledJobs(from, count)));
 }