Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MakarenkoAI committed Oct 29, 2024
1 parent 651ae43 commit 0a8c0a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ ScResult StandardMessageReplyAgent::DoProgram(ScActionInitiatedEvent const & eve
if (!messageNode.IsValid())
{
SC_AGENT_LOG_DEBUG("The action doesn't have a message node");
return action.FinishUnsuccessfully();
}

ScAddr logicRuleNode = generateReplyMessage(messageNode);
ScAddr replyMessageNode = IteratorUtils::getAnyByOutRelation(&m_context, messageNode, MessageKeynodes::nrel_reply);
m_context.GenerateConnector(ScType::EdgeAccessConstPosPerm, MessageKeynodes::concept_message, replyMessageNode);

if (!replyMessageNode.IsValid())
{
SC_AGENT_LOG_ERROR("The reply message isn't generated");
return action.FinishUnsuccessfully();
}

m_context.GenerateConnector(ScType::EdgeAccessConstPosPerm, MessageKeynodes::concept_message, replyMessageNode);
SC_AGENT_LOG_DEBUG("The reply message is generated");

initFields();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ ScResult MessageReplyAgent::DoProgram(ScActionInitiatedEvent const & event, ScAc

ScAction actionToInterpret = m_context.GenerateAction(commonModule::Keynodes::action_interpret_non_atomic_action);
actionToInterpret.SetArguments(processingProgramAddr, generateNonAtomicActionArgsSet(messageAddr));
actionToInterpret.InitiateAndWait(WAIT_TIME);

if (!actionToInterpret.IsFinishedSuccessfully())
if (!actionToInterpret.InitiateAndWait(WAIT_TIME) || !actionToInterpret.IsFinishedSuccessfully())
{
SC_AGENT_LOG_ERROR("Action wait time expired or action not finished successfully");
return action.FinishUnsuccessfully();
Expand Down

0 comments on commit 0a8c0a8

Please sign in to comment.