public void process() { log.Info("WorkAllocationThread process called.."); completedList = new List <string>(); runningList = new List <ThreadBean>(); erroredList = new List <string>(); isRecoveryOnceExecuted = false; //set this flag for recovery to fetch only once bool isSuccess; string msg; createArchLog(out isSuccess, out msg); if (!isSuccess) { log.Error("Create Arch Log Failed, please check the log file :" + msg); return; } Execute(); worker.ReportProgress(computePercent(this.completedList.Count(), totalCount), string.Format("{0}:{1}:{2}", totalCount, completedList.Count(), (totalCount - completedList.Count()))); //duplicate count /*worker.ReportProgress(computePercent(this.completedList.Count() + duplCount, totalCount), * string.Format("{0}:{1}:{2}", totalCount, completedList.Count() + this.duplCount, * (totalCount - (completedList.Count() + this.duplCount))));*/ //duplicate count var archLogDAO = ArchLogDAO.getInstance(); archLogDAO.UpdateArchLog(archLogID, successCount, failedCount, out isSuccess, out msg); log.Info("WorkAllocationThread process Finished.."); if (!isSuccess) { log.Error("Update Arch Log Failed, please check the log file :" + msg); } }
public void process() { runningList = new List <ArchiveJob1>(); isRecoveryOnceExecuted = false; //set this flag for recovery to fetch only once bool isSuccess; string msg; createArchLog(out isSuccess, out msg); if (!isSuccess) { log.Error("Create Arch Log Failed, please check the log file :" + msg); return; } startTimerToPrintMemoryStat(); var sw = new Stopwatch(); sw.Start(); Execute(); sw.Stop(); log.Info("Overall Process Time...." + sw.Elapsed); worker.ReportProgress(computePercent(completedCount, totalCount), string.Format("{0}:{1}:{2}", totalCount, completedCount, (totalCount - completedCount))); this.aTimer.Stop(); ArchLogDAO.getInstance().UpdateArchLog(archLogID, successCount, failedCount, out isSuccess, out msg); log.Info("WorkAllocationThread process Finished.."); if (!isSuccess) { log.Error("Update Arch Log Failed, please check the log file :" + msg); } }
private void createArchLog(out bool isSuccess, out string msg) { var archLogDAO = ArchLogDAO.getInstance(); string srcCouch = this.mainForm.getMainForm().getSourceCouch().serverName + ":" + this.mainForm.getMainForm().getSourceCouch().dbName; string tarCouch = this.mainForm.getMainForm().getTargetCouch().serverName + ":" + this.mainForm.getMainForm().getTargetCouch().dbName; archLogID = archLogDAO.CreateArchLog(this.totalCount, srcCouch, tarCouch, this.mainForm.getMainForm().couchVO.userName, out isSuccess, out msg); }