int Maker::RunCommands(bool keepGoing) { int rv =0 ; //FIXME rv start value!!! bool stop = false; Environment env; GetEnvironment(env); int count; for (std::deque<Depends *>::iterator it = depends.begin(); (rv == 0 || keepGoing) && it != depends.end(); ++it) { CancelOne(*it); } for (std::deque<Depends *>::iterator it = depends.begin(); (rv == 0 || keepGoing) && it != depends.end(); ++it) { rv = RunOne(*it, env, keepGoing); if (rv) stop = true; } for (std::deque<Depends *>::iterator it = depends.begin(); it != depends.end(); ++it) { DeleteOne(*it); } if (stop) return 2; else return rv; }
void Maker::DeleteOne(Depends *depend) { for (Depends::iterator it = depend->begin(); it != depend->end(); ++it) { DeleteOne(*it); } if (depend->ShouldDelete()) OS::RemoveFile(depend->GetGoal()); }
void Cleaner :: run() { m_bIsStart = true; Continue(); uint64_t llInstanceID = m_poCheckpointMgr->GetMinChosenInstanceID(); while (true) { if (m_bIsEnd) { PLGHead("Checkpoint.Cleaner [END]"); return; } if (!m_bCanrun) { PLGImp("Pausing, sleep"); m_bIsPaused = true; Time::MsSleep(1000); continue; } uint64_t llCPInstanceID = m_poSMFac->GetCheckpointInstanceID(m_poConfig->GetMyGroupIdx()) + 1; while (llInstanceID + m_llHoldCount < llCPInstanceID) { bool bDeleteRet = DeleteOne(llInstanceID); if (bDeleteRet) { PLGImp("delete one done, instanceid %lu", llInstanceID); llInstanceID++; } else { PLGErr("delete system fail, instanceid %lu", llInstanceID); break; } } if (llCPInstanceID == 0) { PLGImp("sleep a while, max deleted instanceid %lu checkpoint instanceid (no checkpoint) now instanceid %lu", llInstanceID, m_poCheckpointMgr->GetMaxChosenInstanceID()); } else { PLGImp("sleep a while, max deleted instanceid %lu checkpoint instanceid %lu now instanceid %lu", llInstanceID, llCPInstanceID, m_poCheckpointMgr->GetMaxChosenInstanceID()); } Time::MsSleep(1000); } }