mirror of
https://github.com/typesense/typesense.git
synced 2025-05-20 05:32:30 +08:00
Don't accept empty nodes file.
This commit is contained in:
parent
cc980c2ecd
commit
bf8a2fc6e5
@ -98,6 +98,10 @@ Option<std::string> Config::fetch_file_contents(const std::string & file_path) {
|
||||
std::string content((std::istreambuf_iterator<char>(infile)), (std::istreambuf_iterator<char>()));
|
||||
infile.close();
|
||||
|
||||
if(content.empty()) {
|
||||
return Option<std::string>(400, std::string("Empty file at: ") + file_path);
|
||||
}
|
||||
|
||||
return Option<std::string>(content);
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ int start_raft_server(ReplicationState& replication_state, const std::string& st
|
||||
|
||||
if(!nodes_config_op.ok()) {
|
||||
LOG(ERROR) << nodes_config_op.error();
|
||||
exit(-1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
butil::ip_t peering_ip;
|
||||
|
Loading…
x
Reference in New Issue
Block a user