Beispiel #1
0
        public ScheduleModel ToScheduleModel()
        {
            var model = new ScheduleModel();

            model.Id    = JobPrefixManager.GetJobId(this.GetJobID());
            model.Cron  = this._Cron;
            model.Queue = this._queueName;
            return(model);
        }
Beispiel #2
0
        public static void SetupJobs()
        {
            var id_memoryJobs    = _jobItems.Select(i => JobPrefixManager.GetJobId(i.GetJobID())).ToList();
            var id_persistedJobs = _repo.AllScheduleIDs();

            var creatingIDs = id_memoryJobs.Except(id_persistedJobs);

            foreach (var id in creatingIDs)
            {
                FindById(id).Update();
            }


            var deletingIDs = id_persistedJobs.Except(id_persistedJobs);

            foreach (var id in deletingIDs)
            {
                RecurringJobAmp.RemoveIfExists(id);
            }
        }