예제 #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);
            }
        }
예제 #2
0
        private void tsmi_reparse_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow dr in dgv_url.SelectedRows)
            {
                String url = (String)dr.Cells[0].Value;

                RuntimeEntity runtime = runtimeService.get(url);

                if (runtime.reparse())
                {
                    parseService.add(url, tb_type.Text.Trim());
                }
            }
        }