public bool RegisterSchedule(EnumSchedule schedule, ScheduleDelegateParam scheduleDelegate) { if (_disableSchedule) { return(false); } var config = ScheduleConfig.Instance.GetEntity(schedule); if (config == null) { SystemlogMgr.Error("Schedule register", "can't find schedule config,id:" + (int)schedule); return(false); } ScheduleInfo info = new ScheduleInfo(scheduleDelegate, config); _rwl.AcquireWriterLock(Timeout.Infinite); try { _scheduleInfoDict.Add((int)schedule, info); LogHelper.Insert(schedule.ToString() + " register success.", LogType.Info); } finally { _rwl.ReleaseWriterLock(); } return(true); }
public ConfigScheduleEntity GetEntity(EnumSchedule enumSchedule) { return(GetEntity((int)enumSchedule)); }