// public static ILog log = LogManager.GetLogger(typeof(Global)); void Application_Start(object sender, EventArgs e) { //log4net.Config.DOMConfigurator.Configure(); // GeneralPage.Log("ETEM Application Start at " + DateTime.Now); BaseSettingHelper bsh = new BaseSettingHelper(); bsh.MergeSettingsAll(); Dictionary<string, HttpSessionState> sessionData = new Dictionary<string, HttpSessionState>(); Application[Constants.APPLICATION_ALL_SESSIONS] = sessionData; try { CronProcessHelper cronProcess = new CronProcessHelper(); cronProcess.StartThread(); } catch (Exception ex) { BaseHelper.Log(ex.ToString()); } }
private void CronThread() { while (true) { Setting settings = GetSettingByCode(ETEMEnums.AppSettings.CronProcessStartPeriod); double cronProcessStartPeriod = Convert.ToDouble(settings.SettingValue); Thread.Sleep(TimeSpan.FromMinutes(cronProcessStartPeriod)); log.Debug("CronThread at time:" + DateTime.Now.ToString()); CronProcessHelper cronProcessHelper = new CronProcessHelper(); cronProcessHelper.execute(); } }