Exemple #1
0
        public ClearFilesControlServiceTask(Log log)
        {
            this.log = log;

            SystemDataIsLoaded = false;

            Worker            = new SaleThread();
            Worker.ThreadName = "ClearOldFilesControl";
            Worker.Priority   = ThreadPriority.BelowNormal;
            Worker.Work      += Worker_Work;

            Start();
        }
Exemple #2
0
        void Worker_Work(object sender, ThreadWorkEventArgs e)
        {
            while (!e.Cancel)
            {
                try
                {
                    DeleteOldFiles(Globals.GetPath(PathEnum.Logs), "*." + Globals.LogExtention, 30, SearchOption.TopDirectoryOnly);
                }
                catch
                {
                }

                // Период - 10 минут
                if (!e.Cancel)
                {
                    SaleThread.Sleep(600000);
                }
            }
        }
Exemple #3
0
 public ThreadWorkEventArgs(SaleThread thread)
 {
     Thread = thread;
 }