From 21b7829865f599bc1f997bee490e179985990425 Mon Sep 17 00:00:00 2001 From: Sventimir Date: Fri, 26 Jan 2024 11:27:51 +0100 Subject: [PATCH] Make node status report succeed on any 20x HTTP code. --- src/lib/node_status_service/node_status_service.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/node_status_service/node_status_service.ml b/src/lib/node_status_service/node_status_service.ml index 55ecfad2023..72e1ecd46c8 100644 --- a/src/lib/node_status_service/node_status_service.ml +++ b/src/lib/node_status_service/node_status_service.ml @@ -103,8 +103,10 @@ let send_node_status_data ~logger ~url node_status_data = let metadata = [ ("data", node_status_json); ("url", `String (Uri.to_string url)) ] in - if Cohttp.Code.code_of_status status = 200 then - [%log info] "Sent node status data to URL $url" ~metadata + if + Cohttp.Code.( + code_of_status status >= 200 && code_of_status status < 300) + then [%log info] "Sent node status data to URL $url" ~metadata else let extra_metadata = match body with