mirror of
https://github.com/typesense/typesense.git
synced 2025-05-17 04:02:36 +08:00
Properly exclude config api from resource checks.
Some checks failed
tests / test (push) Has been cancelled
Some checks failed
tests / test (push) Has been cancelled
This commit is contained in:
parent
d60098a6ab
commit
b903ef014b
@ -453,6 +453,8 @@ struct http_req {
|
||||
|
||||
return ip_addr;
|
||||
}
|
||||
|
||||
bool do_resource_check();
|
||||
};
|
||||
|
||||
struct route_path {
|
||||
|
@ -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;
|
||||
|
@ -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";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user