예제 #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;
            }
        }
예제 #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;
			}
		}
예제 #3
0
		public static void Run(JobRoot jobRoot, ReportRoot reportRoot = null)
		{
			var instance = DiContainer.GetService<Monitor>();

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

            instance.RunInjected(jobRoot, reportRoot);
        }