Added: #1440 Abort now possible while plugin is working

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent a28341d04c
commit 23a4326229

@ -290,6 +290,12 @@ public:
finishedTask(m_ActiveProcess->m_SubTaskResult, m_ActiveProcess->m_SubTaskErrorMessage);
break;
}
if (m_AbortRequested)
{
nlinfo("Aborted slave task after getting removed files");
finalizeAbort();
break;
}
// Build the lists of files added changed removed
buildListsOfFiles();
@ -307,8 +313,16 @@ public:
{
m_SlaveTaskState = SOMEWHERE_INBETWEEN;
CInfoFlags::getInstance()->removeFlag(PIPELINE_INFO_PLUGIN_WORKING);
if (m_AbortRequested)
{
nlinfo("Aborted slave task while plugin was working");
finalizeAbort();
}
else
{
finishedTask(m_ActiveProcess->m_SubTaskResult, m_ActiveProcess->m_SubTaskErrorMessage);
}
}
break;
default:
finishedTask(FINISH_ERROR, "Task got lost somewhere inbetween the code of the slave service. This is a programming error. Implementation may be incomplete.");
@ -645,6 +659,9 @@ public:
CInfoFlags::getInstance()->addFlag(PIPELINE_INFO_ABORTING);
m_AbortRequested = true;
if (m_ActiveProcess)
m_ActiveProcess->m_Aborting = true;
// ?TODO?
//m_ActiveProject = NULL;
//m_ActiveProcess = NULL;

@ -46,7 +46,7 @@ using namespace std;
namespace PIPELINE {
CPipelineProcessImpl::CPipelineProcessImpl(CPipelineProject *activeProject) : m_ActiveProject(activeProject), m_SubTaskResult(FINISH_NOT)
CPipelineProcessImpl::CPipelineProcessImpl(CPipelineProject *activeProject) : m_ActiveProject(activeProject), m_SubTaskResult(FINISH_NOT), m_Aborting(false)
{
if (activeProject == NULL)
{

@ -104,6 +104,8 @@ private:
std::set<std::string> m_ListDependentDirectories;
std::set<std::string> m_ListDependentFiles;
bool m_Aborting;
private:
bool getDependencyFileStatusCached(CFileStatus &fileStatus, const std::string &filePath);
bool getDependencyFileStatusLatest(CFileStatus &fileStatus, const std::string &filePath);

@ -506,7 +506,7 @@ void CPipelineProcessImpl::setExit(const TProcessResult exitLevel, const std::st
/// Must verify this regularly to exit the plugin in case something went wrong.
bool CPipelineProcessImpl::needsExit()
{
if (g_IsExiting)
if (g_IsExiting || m_Aborting)
return true;
// TODO: Bypass error feature.

Loading…
Cancel
Save