예제 #1
0
        /// <summary>
        /// 运行处理
        /// </summary>
        /// <param name="source">定时器</param>
        /// <param name="e">定时器参数</param>
        private void timerRun(object source, System.Timers.ElapsedEventArgs e)
        {
            SrcUrlGroupTimer sug = source as SrcUrlGroupTimer;

            ThrowEvent(RunMessage.RunType.TIP, sug.Name + ":定时任务开始执行");

            sug.Handle(this);
            //foreach (ISrcUrl isu in sug.SrcUrl.Values)
            //{
            //    routeProcess(isu, sug);
            //}

            ThrowEvent(RunMessage.RunType.TIP, sug.Name + ":定时任务开始休眠");
        }
예제 #2
0
        /// <summary>
        /// 运行处理
        ///     Elapsed事件放在这里主要是为了能够获取Runner
        /// </summary>
        /// <param name="source">定时器</param>
        /// <param name="e">定时器参数</param>
        private void timer_RunEvent(object source, System.Timers.ElapsedEventArgs e)
        {
            SrcUrlGroupTimer timer = source as SrcUrlGroupTimer;

            if (e != null)
            {
                Thread.CurrentThread.Name = timer.Name + "_Timer(Timer)";
                //TODO 设置Runner timer等信息到线程上下文
            }
            AqiManage.Remind.Log_Debug("定时任务开始执行", new string[] { this.name, timer.Name });
            if (timer.Handle(this))
            {
                AqiManage.Remind.Log_Debug("定时任务开始休眠", new string[] { this.name, timer.Name });
            }
            else
            {
                AqiManage.Remind.Log_Debug("定时器人为取消", new string[] { this.name, timer.Name });
            }
        }