Exemplo n.º 1
0
        static void Main(string[] args)
        {
            DomainExaminationService domainExaminationService = new DomainExaminationService();

            while (true)
            {
                Console.WriteLine($"{DateTime.Now.ToLocalTime()} - Application Running");

                var domainList = new List <DomainExaminationDto>();
                try
                {
                    var filterDomain = domainExaminationService.GetAll().Where(s => s.ToEndTime > DateTime.Now.ToLocalTime() && DateTime.Now.ToLocalTime() > s.ToStartTime && s.Status == 1);

                    domainList = filterDomain.Where(s => DateTime.UtcNow > s.LastExecuted.AddMinutes(s.Interval)).ToList();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }

                if (domainList.Any())
                {
                    MainProcess mainProcess = new MainProcess(domainList);

                    mainProcess.Run();
                }
                Thread.Sleep(30 * 1000);
            }
        }
      public string Post([FromBody] PostData postData)
      {
          if (postData.passwd.Equals("Toffstech_Performance-Monitoring@48969487"))
          {
              var domainList = JsonConvert.DeserializeObject <List <string> >(postData.jsonDomain);

              MainProcess mainProcess = new MainProcess(domainList);
              mainProcess.Run();

              return("Successful");
          }
          else
          {
              return("Failed");
          }
      }
Exemplo n.º 3
0
        public void Run_Default_Return()
        {
            //ISIPRegistrarCore sipRegistrarCore,
            //ISIPTransport sipTransport,
            //ISipAccountStorage sipAccountStorage,
            //IMemoCache< Camera > cameraCache)

            //var ISIPRegistrarCoreMock = new Mock<ISIPRegistrarCore>();
            //var ISIPTransportMock = new Mock<ISIPTransport>();
            //var ISipAccountStorageMock = new Mock<ISipAccountStorage>();
            //SipAccountStorage sas = new SipAccountStorage();
            ////ISipAccountStorageMock.Setup(accouts=> accouts.Accounts.Add(new GB28181.App.SIPAccount { })) ;
            //var IMemoCacheMock = new Mock<IMemoCache<Camera>>();
            var obj = new MainProcess();

            obj.Run();

            Assert.NotNull(obj);
        }