1
0
Fork 0

removed unnecessary block

This commit is contained in:
Jan Steemann 2016-01-29 11:10:24 +01:00
parent c3fc7e1aa7
commit b82e9c692a
1 changed files with 7 additions and 12 deletions

View File

@ -238,20 +238,15 @@ bool ServerState::isRunningInCluster() {
////////////////////////////////////////////////////////////////////////////////
ServerState::RoleEnum ServerState::getRole() {
std::string id;
std::string info;
auto role = loadRole();
{
auto role = loadRole();
if (role != ServerState::ROLE_UNDEFINED || !_clusterEnabled) {
return role;
}
info = _localInfo;
id = _id;
if (role != ServerState::ROLE_UNDEFINED || !_clusterEnabled) {
return role;
}
std::string info = _localInfo;
std::string id = _id;
if (id.empty()) {
// We need to announce ourselves in the agency to get a role configured:
LOG_DEBUG("Announcing our birth in Current/NewServers to the agency...");
@ -275,7 +270,7 @@ ServerState::RoleEnum ServerState::getRole() {
}
// role not yet set
RoleEnum role = determineRole(info, id);
role = determineRole(info, id);
std::string roleString = roleToString(role);
LOG_DEBUG("Found my role: %s", roleString.c_str());