private void DoJobsNow() { log.Info("Running jobs now..."); if (scheduler == null) { log.Error("Can't run jobs now: no one job was created"); return; } List <int> list = new List <int>(); foreach (KeyValuePair <CronExpression, List <int> > csi in projectIdsByCronExpressions) { list.AddRange(csi.Value); } if (list.Count == 0) { log.Info("There are no projects to check."); return; } JobDataMap data = new JobDataMap(); data[triggerProjectIds] = list; int numChannels = AppSettings.GetOutgoingChannels(); for (int i = 0; i < numChannels; ++i) { scheduler.TriggerJob(new JobKey(jobNameTemplate + i), data); } }
private int GetOutgoingChannels() { int numChannels = AppSettings.GetOutgoingChannels(); if (numChannels == -1) { log.Warn(AppSettings.OutgoingChannelsKey + " is not set properly in the configuration file."); int device = AppSettings.GetLineDevice(); // TODO log.Info(AppSettings.OutgoingChannelsKey + " temporarily is set to " + numChannels); ConfigurationManager.AppSettings[AppSettings.OutgoingChannelsKey] = numChannels.ToString(); } return(numChannels); }