예제 #1
0
        /// <summary>
        /// 入重试队列
        ///     定时器线程
        /// </summary>
        /// <param name="arName"></param>
        /// <param name="isu"></param>
        /// <param name="ap"></param>
        /// <param name="ex"></param>
        public void PutNew(string arName, ISrcUrl isu, AqiParam ap, Exception ex)
        {
            //封装为重试节点
            RetryNode arn = new RetryNode(arName, isu, ap);

            arn.NodeEvent += new RetryNode.NodeEventHandler(this.node_RunEvent);
            //更新计数
            arn.Update(ex);
            //添加历史记录
            arn = this.AddHistory(arn);
            //入队列
            this.Push(arn.Name);
            AqiManage.Remind.Log_Info("已添加到重试队列", new string[] { this.name, arn.RunnerName, arn.Name });
        }
예제 #2
0
 /// <summary>
 /// 再次入重试队列
 ///     循环线程
 /// </summary>
 /// <param name="arn"></param>
 /// <param name="ex"></param>
 public void PutAgain(RetryNode arn, Exception ex)
 {
     //更新计数
     arn.Update(ex);
     //检查有效性
     if (!arn.IsValid())
     {
         //读取配置
         if (AqiManage.Setting.Get <bool>("AqiRetryer.AlwayRetry"))
         {
             //继续重试
             AqiManage.Remind.Log_Debug("重试已经无效,仍然尝试重试", new string[] { this.name, arn.RunnerName });
         }
         else
         {
             //停止重试
             AqiManage.Remind.Log_Error("重试已经无效,暂停", new string[] { this.name, arn.RunnerName });
             return;
         }
     }
     //入队列:继续重试
     this.Push(arn.Name);
     AqiManage.Remind.Log_Info("已添加到重试队列", new string[] { this.name, arn.RunnerName, arn.Name });
 }