Beispiel #1
0
        /// <summary>
        /// 数据回删纯程
        /// </summary>
        private static void AutoDataDeleteThread(object o)
        {
            PMManager  atutoDataDelete   = o as PMManager;
            DataDelete pmFirstStatistics = new DataDelete();
            long       tempDataTime      = Convert.ToInt64(DateTime.Now.ToString("HHmm"));

            if (tempDataTime < 200 || tempDataTime > 210)//时间02:00-02:10之间运行
            {
                atutoDataDelete.IBoolIsThreadDataDeleteWorking = false;
            }
            while (atutoDataDelete.IBoolIsThreadDataDeleteWorking)
            {
                try
                {
                    FileLog.WriteInfo("AutoDataDeleteThread", " Start");
                    //读数据库连接串
                    if (IIntDatabaseType == 0 || string.IsNullOrEmpty(IStrDatabaseProfile))
                    {
                        Thread.Sleep(1000 * 1);
                        continue;
                    }
                    pmFirstStatistics.IDatabaseConfig.IntDatabaseType    = IIntDatabaseType;
                    pmFirstStatistics.IDatabaseConfig.StrDatabaseProfile = IStrDatabaseProfile;
                    pmFirstStatistics.RunDataDelete();
                    Thread.Sleep(1000 * 30);
                }
                catch (Exception e)
                {
                    FileLog.WriteError("AutoDataDeleteThread", e.Message.ToString());
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 统计服务线程
        /// </summary>
        /// <param name="o"></param>
        private static void AutoPMStatisticsThread(object o)
        {
            PMManager         atutoPMStatistcs  = o as PMManager;
            PMFirstStatistics pmFirstStatistics = new PMFirstStatistics();

            FileLog.WriteInfo("AutoPMStatisticsThread", " Start");
            while (atutoPMStatistcs.IBoolIsThreadPMStatisticsWorking)
            {
                try
                {
                    //+++++++++++++++++++++++++++++++++++++++++++++++++++
                    //IIntDatabaseType = 3;
                    //IStrDatabaseProfile = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.4.182) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME= PFOrcl)));User Id=PFDEV831; Password=pfdev831";
                    //pmFirstStatistics.IDatabaseConfig.IntDatabaseType = 3;

                    //pmFirstStatistics.IDatabaseConfig.StrDatabaseProfile = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.4.182) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME= PFOrcl)));User Id=PFDEV831; Password=pfdev831";



                    //IIntDatabaseType = 2;
                    //IStrDatabaseProfile = "Data Source=192.168.9.118,1433;Initial Catalog=UMPDataDB_Demo;User Id=sa;Password=voicecodes";
                    //pmFirstStatistics.IDatabaseConfig.IntDatabaseType = 2;
                    //pmFirstStatistics.IDatabaseConfig.StrDatabaseProfile = "Data Source=192.168.9.118,1433;Initial Catalog=UMPDataDB_Demo;User Id=sa;Password=voicecodes";
                    ////+++++++++++++++++++++++++++++++++++++++++++++++++++


                    //读数据库连接串
                    if (IIntDatabaseType == 0 || string.IsNullOrEmpty(IStrDatabaseProfile))
                    {
                        Thread.Sleep(1000 * 1);
                        continue;
                    }
                    pmFirstStatistics.IDatabaseConfig.IntDatabaseType    = IIntDatabaseType;
                    pmFirstStatistics.IDatabaseConfig.StrDatabaseProfile = IStrDatabaseProfile;
                    pmFirstStatistics.RunFirstStatistics();
                    Thread.Sleep(100);
                }
                catch (Exception e)
                {
                    FileLog.WriteError("AutoPMStatisticsThread", e.Message.ToString());
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// 日志检查线程
        /// </summary>
        private static void AutoLogCheckThread(object o)
        {
            PMManager    autoLogCheck = o as PMManager;
            LogOperation logOperation = new LogOperation();

            while (autoLogCheck.IBoolIsThreadLogCheckWorking)
            {
                try
                {
                    logOperation.LogCompressionAndDelete();
                    Thread.Sleep(100);
                }
                catch (Exception e)
                {
                    FileLog.WriteError("AutoLogCheckThread() ", e.Message);
                    Thread.Sleep(5 * 60 * 1000);
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// 数据库检查线程
        /// </summary>
        /// <param name="o"></param>
        private static void AutoDBCheckThread(object o)
        {
            PMManager autoDBInfo = o as PMManager;

            while (autoDBInfo.IBoolIsDBInfoWorking)
            {
                try
                {
                    if (IIntDatabaseType == 0 || string.IsNullOrEmpty(IStrDatabaseProfile))
                    {
                        autoDBInfo.GetDatabaseConnectionProfile();
                        Thread.Sleep(1000);
                    }
                    Thread.Sleep(1000 * 15);
                }
                catch (Exception e)
                {
                    FileLog.WriteError("AutoDBCheckThread() ", e.Message);
                    Thread.Sleep(5 * 60 * 1000);
                }
            }
        }