Пример #1
0
        static void Main(string[] args)
        {
            var downloadInitiator = new DownloadInitiator();
            var sleep             = 10;

            while (true)
            {
                var items = downloadInitiator.ProcessTickConsoleVersion();
                Console.WriteLine("Process " + items.ToString()
                                  + " with no errors" + DateTime.Now.ToString());
                if (items == 0)
                {
                    Console.WriteLine("sleeping a few seconds " + sleep.ToString());
                    for (var i = 0; i < sleep; i++)
                    {
                        System.Threading.Thread.Sleep(1000);
                        if (ChekConsoleExitCondition())
                        {
                            return;
                        }
                    }
                    if (sleep < 300)
                    {
                        sleep += 5;
                    }
                }
                else
                {
                    if (ChekConsoleExitCondition())
                    {
                        return;
                    }
                    sleep = 5;
                }
            }
        }
Пример #2
0
 public void TestProcessTick()
 {
     var processInitiator = new DownloadInitiator();
     var errors           = processInitiator.ProcessTickConsoleVersion();
 }