コード例 #1
0
        /**
         * 守护进程
         */
        private void daemon_timer_Tick(object sender, EventArgs e)
        {
            try
            {
                tssl_mail_send_status.Text = "待发邮件:" + MailSendService.sendWaitCnt + "; 已发邮件:" + MailSendService.sendSuccessCnt + "; 无法发送数:" + MailSendService.sendErrorCnt;

                //如果队列已经结束,则重跑邮箱解析为0的站点
                if (ckb_reparse.Checked && ThreadPoolEx.IsIdle() && runtimeService.getAll().Count > 0)
                {
                    foreach (DictionaryEntry de in (Hashtable)runtimeService.getAll().Clone())
                    {
                        RuntimeEntity runtime = (RuntimeEntity)de.Value;

                        if (runtime.AllMailCnt == 0 && runtime.reparse())
                        {
                            parseService.add((String)de.Key, tb_type.Text.Trim());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message, ex);
            }
        }