Commit 15a9c887 authored by Francis Dupont's avatar Francis Dupont Committed by Marcin Siodelski
Browse files

[#1041] Checkpoint: fixed and improved HA, reload time todo

parent df955449
......@@ -275,10 +275,22 @@ HAImpl::commandProcessed(hooks::CalloutHandle& callout_handle) {
return;
}
// Add the ha state to arguments.
std::string state = stateToString(service_->getCurrState());
ElementPtr mutable_resp_args =
boost::const_pointer_cast<Element>(response);
mutable_resp_args->set("ha-state", Element::create(state));
boost::const_pointer_cast<Element>(resp_args);
int state = service_->getCurrState();
try {
mutable_resp_args->set("ha-state",
Element::create(stateToString(state)));
} catch (const std::exception&) {
return;
}
state = service_->getPartnerState();
try {
mutable_resp_args->set("ha-partner-state",
Element::create(stateToString(state)));
} catch (const std::exception&) {
return;
}
}
}
......
......@@ -246,6 +246,12 @@ public:
/// queries.
void waitingStateHandler();
/// @brief Returns last known state of the partner.
/// @ref CommunicationState::getPartnerState.
int getPartnerState() const {
return (communication_state_->getPartnerState());
}
protected:
/// @brief Transitions to a desired state and logs it.
......
Markdown is supported
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