/// <summary> /// 统计服务线程 /// </summary> /// <param name="o"></param> private static void AutoABCDStatisticsThread(object o) { ABCDManager autoABCDStatistics = o as ABCDManager; ABCDStatistics abcdStatistics = new ABCDStatistics(); while (autoABCDStatistics.IBoolIsThreadABCDStatisticsWorking) { //+++++++++++++++++++++++++++++++++++++++++++++++++++ //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.7.101,1433;Initial Catalog=UMPDataDB0509;User Id=sa;Password=voicecodes"; //abcdStatistics.IIntDatabaseType = 2; //abcdStatistics.IStrDatabaseProfile = "Data Source=192.168.7.101,1433;Initial Catalog=UMPDataDB0509;User Id=sa;Password=voicecodes"; //////+++++++++++++++++++++++++++++++++++++++++++++++++++ //读数据库连接串 if (IIntDatabaseType == 0 || string.IsNullOrEmpty(IStrDatabaseProfile)) { Thread.Sleep(1000 * 1); continue; } try { //读取所有的运行周期的 abcdStatistics.IIntDatabaseType = IIntDatabaseType; abcdStatistics.IStrDatabaseProfile = IStrDatabaseProfile; abcdStatistics.RunABCDStatistics(); Thread.Sleep(1000 * 15); } catch (Exception e) { FileLog.WriteError("AutoLogCheckThread() ", e.Message); Thread.Sleep(1000 * 15); } } }
/// <summary> /// 日志检查线程 /// </summary> private static void AutoLogCheckThread(object o) { ABCDManager autoLogCheck = o as ABCDManager; 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); } } }
private static void AutoDBCheckThread(object o) { ABCDManager autoDBInfo = o as ABCDManager; 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); } } }