Esempio n. 1
0
 public static SchedulerCenter GetInstance()
 {
     if (instance == null)
     {
         lock (objLock)
         {
             if (instance == null)
             {
                 instance = new SchedulerCenter();
             }
         }
     }
     return(instance);
 }
Esempio n. 2
0
 /// <summary>
 /// 运行配置的工作计划
 /// </summary>
 /// <param name="config"></param>
 public void RunConfigJobs(string config)
 {
     try
     {
         var tempList = XmlSerializer.Load <Schedulers>(config);
         foreach (var item in tempList.SchedulerList)
         {
             var tempResult = SchedulerCenter.GetInstance().RunScheduleJob(item);
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
     }
 }