Exemple #1
0
        public void RunInjected(JobRoot jobRoot, ReportRoot reportRoot = null)
        {
            try
            {
                if (jobRoot == null)
                {
                    throw new ArgumentException("jobRoot is required");
                }

                var jobs = Task.Run(async() => await jobRoot.RunAllAsync());

                if (reportRoot != null)
                {
                    //run reports syncronously
                    AsyncContext.Run(async() => await reportRoot.RunAllAsync());
                }
                else
                {
                    jobs.Wait();
                }
            }
            catch (Exception exception)
            {
                SystemLogRepository.Save(exception, $"Fatal PingWin error.");
                throw;
            }
        }
Exemple #2
0
		public void RunInjected(JobRoot jobRoot, ReportRoot reportRoot = null)
		{
			try
			{
				if (jobRoot == null) throw new ArgumentException("jobRoot is required");

				var jobs = Task.Run(async () => await jobRoot.RunAllAsync());

				if (reportRoot != null)
				{
					//run reports syncronously
					AsyncContext.Run(async () => await reportRoot.RunAllAsync());
				}
				else
				{
					jobs.Wait();
				}
			}
			catch (Exception exception)
			{
				SystemLogRepository.Save(exception, $"Fatal PingWin error.");
				throw;
			}
		}
		private static void CreateJob(JobRoot root, string name, IRule rule)
		{
			root.Records.Add(new JobRecord() {Name = name});
			root.AddJob(name, rule);
		}
Exemple #4
0
		public static void Run(JobRoot jobRoot, ReportRoot reportRoot = null)
		{
			var instance = DiContainer.GetService<Monitor>();

			instance.RunInjected(jobRoot, reportRoot);
		}
Exemple #5
0
        public static void Run(JobRoot jobRoot, ReportRoot reportRoot = null)
        {
            var instance = DiContainer.GetService <Monitor>();

            instance.RunInjected(jobRoot, reportRoot);
        }