Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
			}
		}
Exemplo n.º 3
0
		private static void CreateJob(JobRoot root, string name, IRule rule)
		{
			root.Records.Add(new JobRecord() {Name = name});
			root.AddJob(name, rule);
		}
Exemplo n.º 4
0
		public static void Run(JobRoot jobRoot, ReportRoot reportRoot = null)
		{
			var instance = DiContainer.GetService<Monitor>();

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

            instance.RunInjected(jobRoot, reportRoot);
        }