///<summary> ///Obtiene las tareas de un repositorio ///</summary> ///<param name="repositoryID">Identificador del repositorio</param> ///<returns>Lista de tareas</returns> public List <JobViewModel> GetJobs(Guid repositoryID) { List <JobViewModel> jobs = new List <JobViewModel>(); List <string> jobsId = _context.JobRepository.Where(item => item.IdRepository.Equals(repositoryID) && item.FechaEjecucion < DateTime.Now && !item.IdJob.Contains("_")).Select(item => item.IdJob).ToList(); foreach (string id in jobsId) { var job = _cronApiService.GetJob(id); if (job != null) { jobs.Add(job); } } return(jobs.OrderByDescending(item => item.ExecutedAt).ToList()); }
public IActionResult GetJob(string id) { return(Ok(_cronApiService.GetJob(id))); }