/// <summary> /// Private method to complete operation for each job /// </summary> /// <param name="job">Instance of Job</param> /// <exception>All Exception should be Managed by the called mailer , If any Exception in between let it propagate to top</exception> private void ExecuteTrainingTrackerJob(TaskSchedulerJob job) { int allowedFailedAttempts; Int32.TryParse(Constants.MyDllConfigAppSettings.Settings["AllowedFailedAttempts"].Value ?? 0.ToString(), out allowedFailedAttempts); Mailer.StartEmailRun(new SchedulerDataAccess().GetAllPendingEmailContentAndCorrespondingRecipientForJob(job, allowedFailedAttempts)); }
protected void Application_End() { TaskSchedulerJob.Stop(); TelemetryHelper.WriteEvent(TelemetryEventNames.WebAppEnd); TelemetryHelper.LogInformation(FormattableString.Invariant($"Application_End, shutdown reason = {HostingEnvironment.ShutdownReason}")); TelemetryHelper.Flush(); Thread.Sleep(TimeSpan.FromSeconds(2)); }
protected void Application_Start() { ConfigHelper.InitializeAsync().GetAwaiter().GetResult(); TelemetryHelper.WriteEvent(TelemetryEventNames.WebAppStart); TelemetryHelper.LogInformation("Application_Start"); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier; DataAccess.InitDatabase(); TaskSchedulerJob.Start(); }