コード例 #1
0
 public AnalysisRequestsLoader(ILog log, ICommandProcessingQueue <IExecutableCommand> queue,
                               IWorkloadAnalysesRepository workloadAnalysesRepository, ICommandChainFactory chainFactory)
 {
     this.log   = log;
     this.queue = queue;
     this.workloadAnalysesRepository = workloadAnalysesRepository;
     this.chainFactory   = chainFactory;
     this.timer          = new Timer(60000);
     this.timer.Elapsed += Timer_Elapsed;
     Timer_Elapsed(null, null);
 }
コード例 #2
0
        private static Dictionary <TimeSpan, IExecutableCommand> PlanRegularTasks(ICommandChainFactory chains)
        {
            var regularTasks = new Dictionary <TimeSpan, IExecutableCommand>();

            regularTasks.Add(new TimeSpan(2, 0, 0), new ActionCommand(() =>
            {
                DateTime previousDay      = DateTime.Now.Date.AddDays(-1);
                var context               = new ReportContextWithModel <SummaryEmailModel>();
                context.DateFromInclusive = previousDay;
                context.DateToExclusive   = previousDay.AddDays(1);
                context.TemplateId        = DAL.Contracts.SettingPropertyKeys.EMAIL_TEMPLATE_SUMMARY_REPORT;
                chains.SummaryReportChain(context).Execute();
                return(true);
            }));
            return(regularTasks);
        }