Commit 973a4914 authored by Nick Draper's avatar Nick Draper
Browse files

restore what turned out to be a useful boolean value

parent 86d8d3c9
...@@ -672,6 +672,10 @@ bool Algorithm::executeInternal() { ...@@ -672,6 +672,10 @@ bool Algorithm::executeInternal() {
if (m_alwaysStoreInADS) if (m_alwaysStoreInADS)
this->store(); this->store();
// just cache the value internally, it is set at the very end of this
// method
algIsExecuted = true;
// Log that execution has completed. // Log that execution has completed.
getLogger().debug( getLogger().debug(
"Time to validate properties: " + "Time to validate properties: " +
...@@ -698,12 +702,13 @@ bool Algorithm::executeInternal() { ...@@ -698,12 +702,13 @@ bool Algorithm::executeInternal() {
} }
} catch (std::logic_error &ex) { } catch (std::logic_error &ex) {
m_gcTime = Mantid::Types::Core::DateAndTime::getCurrentTime() +=
(Mantid::Types::Core::DateAndTime::ONE_SECOND * DELAY_BEFORE_GC);
notificationCenter().postNotification( notificationCenter().postNotification(
new ErrorNotification(this, ex.what())); new ErrorNotification(this, ex.what()));
setResultState(ResultState::Failed); setResultState(ResultState::Failed);
this->unlockWorkspaces(); this->unlockWorkspaces();
m_gcTime = Mantid::Types::Core::DateAndTime::getCurrentTime() +=
(Mantid::Types::Core::DateAndTime::ONE_SECOND * DELAY_BEFORE_GC);
if (m_isChildAlgorithm || m_runningAsync || m_rethrow) if (m_isChildAlgorithm || m_runningAsync || m_rethrow)
throw; throw;
else { else {
...@@ -714,10 +719,10 @@ bool Algorithm::executeInternal() { ...@@ -714,10 +719,10 @@ bool Algorithm::executeInternal() {
} }
} catch (CancelException &ex) { } catch (CancelException &ex) {
m_runningAsync = false; m_runningAsync = false;
getLogger().warning() << this->name() << ": Execution cancelled by user.\n";
m_gcTime = Mantid::Types::Core::DateAndTime::getCurrentTime() += m_gcTime = Mantid::Types::Core::DateAndTime::getCurrentTime() +=
(Mantid::Types::Core::DateAndTime::ONE_SECOND * DELAY_BEFORE_GC); (Mantid::Types::Core::DateAndTime::ONE_SECOND * DELAY_BEFORE_GC);
setResultState(ResultState::Failed); setResultState(ResultState::Failed);
getLogger().warning() << this->name() << ": Execution cancelled by user.\n";
notificationCenter().postNotification( notificationCenter().postNotification(
new ErrorNotification(this, ex.what())); new ErrorNotification(this, ex.what()));
this->unlockWorkspaces(); this->unlockWorkspaces();
...@@ -726,16 +731,15 @@ bool Algorithm::executeInternal() { ...@@ -726,16 +731,15 @@ bool Algorithm::executeInternal() {
} }
// Gaudi also specifically catches GaudiException & std:exception. // Gaudi also specifically catches GaudiException & std:exception.
catch (std::exception &ex) { catch (std::exception &ex) {
m_runningAsync = false;
getLogger().error() << "Error in execution of algorithm " << this->name()
<< ":\n"
<< ex.what() << "\n";
m_gcTime = Mantid::Types::Core::DateAndTime::getCurrentTime() += m_gcTime = Mantid::Types::Core::DateAndTime::getCurrentTime() +=
(Mantid::Types::Core::DateAndTime::ONE_SECOND * DELAY_BEFORE_GC); (Mantid::Types::Core::DateAndTime::ONE_SECOND * DELAY_BEFORE_GC);
setResultState(ResultState::Failed); setResultState(ResultState::Failed);
m_runningAsync = false;
notificationCenter().postNotification( notificationCenter().postNotification(
new ErrorNotification(this, ex.what())); new ErrorNotification(this, ex.what()));
getLogger().error() << "Error in execution of algorithm " << this->name()
<< ":\n"
<< ex.what() << "\n";
this->unlockWorkspaces(); this->unlockWorkspaces();
throw; throw;
} }
...@@ -760,11 +764,13 @@ bool Algorithm::executeInternal() { ...@@ -760,11 +764,13 @@ bool Algorithm::executeInternal() {
m_gcTime = Mantid::Types::Core::DateAndTime::getCurrentTime() += m_gcTime = Mantid::Types::Core::DateAndTime::getCurrentTime() +=
(Mantid::Types::Core::DateAndTime::ONE_SECOND * DELAY_BEFORE_GC); (Mantid::Types::Core::DateAndTime::ONE_SECOND * DELAY_BEFORE_GC);
setResultState(ResultState::Success); if (algIsExecuted) {
// Only gets to here if algorithm ended normally setResultState(ResultState::Success);
notificationCenter().postNotification(new FinishedNotification(this, true)); // Only gets to here if algorithm ended normally
notificationCenter().postNotification(
return true; new FinishedNotification(this, isExecuted()));
}
return isExecuted();
} }
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment