/// <summary> /// Update SQL DB and Job scheduler from incoming folder /// </summary> private void runSQLUpdate() { log("UPDATESQL has been initiated"); deleteUpdateSQLFLG(); DBUpdater updater = new DBUpdater(); Dictionary <JobTemplate, UpdateType> jobIDs = updater.updateFromIncoming(); if (jobIDs != null) { foreach (var key in jobIDs) { if (key.Value == UpdateType.Add) { scheduler.setUpJob(scheduler.loadJobFromDB(key.Key.ID.ToString())); } else if (key.Value == UpdateType.Change) { scheduler.removeJobFromScheduler(key.Key.ID.ToString()); scheduler.setUpJob(key.Key); } else if (key.Value == UpdateType.Remove) { scheduler.removeJobFromScheduler(key.Key.ID.ToString()); } } } }
public void onStartMethod() { setupEventLog(); checkDirectories(); EventLog.WriteEntry("Quartz Scheduler is starting"); Task.Factory.StartNew(() => RunConsumer()); log("QuartzScheduler is starting"); //Process any incoming updates at startup DBUpdater updater = new DBUpdater(); updater.updateFromIncoming(); //Start the job scheduler scheduler = new JobScheduler(); scheduler.Start(); startWCFServer(); watchForUpdates(); }