Пример #1
0
        private void MigrateJobs(MyDBContext context, IScheduler scheduler)
        {
            //Check if there are jobs in the QDMS db and no jobs in the quartz db - in that case we migrate them
            var repo = new JobsRepository(context, scheduler);

            if (context.DataUpdateJobs.Any() && scheduler.GetJobKeys(GroupMatcher <JobKey> .AnyGroup()).Count == 0)
            {
                foreach (DataUpdateJobSettings job  in context.DataUpdateJobs)
                {
                    repo.ScheduleJob(job);
                }
            }
        }