Example #1
0
        public override void Handle()
        {
            // Find all attachment topics, then filter the matched these.
            // 若设置从缓存中提取的数据,需要在 RefreshTopicCacheJobHandler 中重新设定
            var attachmentTopics = TopicCacheManager.Instance.GetAttachmentTopicCache();

            if (attachmentTopics == null || !attachmentTopics.Any())
            {
                return;
            }

            var calibration = new JobTaskCalibration(attachmentTopics);
            var topics      = calibration.FilterTopics;

            if (!topics.Any())
            {
                return;
            }

            // Check the report is enabled, and get the report information by the report id.
            // Execute the sqlstatement and it's paramters.
            foreach (var topic in topics)
            {
                IJobHandler job = new AttachmentJobHandler((AttachmentTopicDto)topic.Key, topic.Value);
                job.Execute();
            }
        }
Example #2
0
        public void ExecuteAttachmentJob_Test()
        {
            AttachmentTopicDto topic;

            using (var service = ServiceLocator.Instance.Resolve <ISubscriberService>())
            {
                topic = service.FindAttachmentTopic(new Guid("9AEDF329-CED8-C7EA-CFDD-08D36469B6E1"));
            }

            var job = new AttachmentJobHandler(topic, topic.TopicTasks);

            job.Execute();
        }