Properly exclude config api from resource checks.
Some checks failed
tests / test (push) Has been cancelled

This commit is contained in:
Kishore Nallan 2024-10-08 13:32:10 +05:30
parent d60098a6ab
commit b903ef014b
3 changed files with 7 additions and 2 deletions

View File

@ -453,6 +453,8 @@ struct http_req {
return ip_addr;
}
bool do_resource_check();
};
struct route_path {

View File

@ -266,8 +266,7 @@ void BatchedIndexer::run() {
config.get_disk_used_max_percentage(),
config.get_memory_used_max_percentage());
if (resource_check != cached_resource_stat_t::OK &&
orig_req->http_method != "DELETE" && found_rpath->handler != post_health) {
if (resource_check != cached_resource_stat_t::OK && orig_req->do_resource_check()) {
const std::string& err_msg = "Rejecting write: running out of resource type: " +
std::string(magic_enum::enum_name(resource_check));
LOG(ERROR) << err_msg;

View File

@ -53,3 +53,7 @@ std::string route_path::_get_action() {
return resource_path + ":" + operation;
}
bool http_req::do_resource_check() {
return http_method != "DELETE" && path_without_query != "/health" && path_without_query != "/config";
}