Skip to content

Commit

Permalink
Fix spurious logs when nodes file is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
kishorenc committed Mar 7, 2024
1 parent a7f9354 commit 8a516e6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/typesense_server_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,14 @@ int start_raft_server(ReplicationState& replication_state, const std::string& st
const Option<std::string> & refreshed_nodes_op = Config::fetch_nodes_config(path_to_nodes);
if(!refreshed_nodes_op.ok()) {
LOG(WARNING) << "Error while refreshing peer configuration: " << refreshed_nodes_op.error();
continue;
}

const std::string& nodes_config = ReplicationState::to_nodes_config(peering_endpoint, api_port,
refreshed_nodes_op.get());
replication_state.refresh_nodes(nodes_config, raft_counter, reset_peers_on_error);
} else {
const std::string& nodes_config = ReplicationState::to_nodes_config(peering_endpoint, api_port,
refreshed_nodes_op.get());
replication_state.refresh_nodes(nodes_config, raft_counter, reset_peers_on_error);

if(raft_counter % 60 == 0) {
replication_state.do_snapshot(nodes_config);
if(raft_counter % 60 == 0) {
replication_state.do_snapshot(nodes_config);
}
}
}

Expand Down

0 comments on commit 8a516e6

Please sign in to comment.