Esempio n. 1
0
        public bool AbortJob(string guid)
        {
            var job = _jobQueue.Find(j => j.Guid == guid).FirstOrDefault();

            if (job == null)
            {
                return(false);
            }

            if (job.Status == ExecutionStatus.RUNNING ||
                job.Status == ExecutionStatus.QUEUED)
            {
                if (!StopJob(job))
                {
                    return(false);
                }
            }

            _jobQueue.Update(new Dictionary <string, ExecutionStatus> {
                { job.Guid, ExecutionStatus.ABORTED }
            });

            return(true);
        }