本文整理汇总了C#中IScheduler.BuildJob方法的典型用法代码示例。如果您正苦于以下问题:C# IScheduler.BuildJob方法的具体用法?C# IScheduler.BuildJob怎么用?C# IScheduler.BuildJob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScheduler
的用法示例。
在下文中一共展示了IScheduler.BuildJob方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public void Start()
{
log.Info("Start requested");
try
{
repositoryContext = new MongoContext(ConfigurationManager.AppSettings["ConnectionString"], "Encore");
repositoryContext.TryConnect();
poolPartyClient = new PoolPartyClient(
ConfigurationManager.AppSettings["PoolParty.EncoreUrl"],
ConfigurationManager.AppSettings["PoolParty.UserName"],
ConfigurationManager.AppSettings["PoolParty.Password"]);
var container = new TinyIoCContainer();
ConfigureContainer(container);
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
scheduler = schedulerFactory.GetScheduler();
scheduler.JobFactory = new ServiceJobFactory(container);
scheduler.ListenerManager.AddJobListener(new LoggingJobListener(), GroupMatcher<JobKey>.AnyGroup());
scheduler.BuildJob<ProcessReportsJob>().
WithRepeatingTrigger(int.Parse(ConfigurationManager.AppSettings["Report.PollIntervalMs"]));
scheduler.BuildJob<SyncSummaryDataJob>().
WithDailyTrigger(TimeOfDay.HourAndMinuteOfDay(0, 0));
scheduler.BuildJob<CleanUpResultsJob>().
UsingJobData("DeleteAfterDays", int.Parse(ConfigurationManager.AppSettings["Report.DeleteAfterDays"])).
WithDailyTrigger(TimeOfDay.HourAndMinuteOfDay(1, 0));
scheduler.BuildJob<SyncSiteAndFieldData>().
WithDailyTrigger(TimeOfDay.HourAndMinuteOfDay(2, 0));
scheduler.Start();
}
catch (Exception ex)
{
log.Error(ex);
throw;
}
}