public YADataDBURLQueue(string dbConnectionString, int mode = 0)
        {
            Console.WriteLine("Создаем очередь");
            tick += Tick;
            work = false;
            jobs_made = 0;
            got_jobs = new Queue<DataDBURLJob>(0);
            photo_aps = new Queue<DirtyApartments>(0);
            disposed = false; 
            //обновляем ссылку на подключение к базе для всяких асинхронных передач данных в духе ошибок
            ddbs = new DataDBAsynchService(dbConnectionString);
            ddbs.WriteErrorMessage(dbConnectionString, 0, "", "start");
            //получаем задания на парсинг
            jobs = new DataDBURLJobs(ddbs, mode, false);
            //jobs.SetJobToStartOrStop(true);
            t_fill = new System.Timers.Timer();
            t_fill.Elapsed += new System.Timers.ElapsedEventHandler(fill_timer);
            t_fill.Interval = 30000;
            t_restart = new System.Timers.Timer();
            t_restart.Elapsed += new System.Timers.ElapsedEventHandler(restart_timer);
            //рестартить раз в 12 часов
            t_restart.Interval = 12 * 60 * 60 * 1000;
            this.mode = mode;

            pq = new PhotoQueue(ddbs);
            arw = new AsyncRunWork();
            ap = new apartments();
            work = true;
            t_fill.Start();
            t_restart.Start();
            Console.WriteLine("Создали очередь");
        }
 //процедура создания цикла скачивания
 public void Processing(bool get_immediately = false)
 {
     Console.WriteLine(DateTime.Now.ToLongTimeString() + " Начат запуск очереди");
     ap = new apartments();
     work = true;
     //made_old = 0; 
     jobs_made = 0;
     t_fill.Start();
     t_restart.Start();
     if (get_immediately)
     {
         send_flag = true;
         FillQueue();
         send_flag = false;
     }
     Console.WriteLine(DateTime.Now.ToLongTimeString() + " Завершен запуск очереди");
 }