From 2467a0af12c3abb434fe6860146b9feac64dfd5c Mon Sep 17 00:00:00 2001 From: Nutomic Date: Thu, 12 Dec 2024 14:38:16 +0000 Subject: [PATCH] Consider remote instance as dead if it returns any status 4xx or 5xx (#5256) * Consider remote instance as dead if it returns any status 4xx or 5xx (ref #3134) * remove dbg --- src/scheduled_tasks.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scheduled_tasks.rs b/src/scheduled_tasks.rs index 52962877fbd..3406bf69433 100644 --- a/src/scheduled_tasks.rs +++ b/src/scheduled_tasks.rs @@ -579,13 +579,13 @@ async fn build_update_instance_form( // This is the only kind of error that means the instance is dead return None; }; + let status = res.status(); + if status.is_client_error() || status.is_server_error() { + return None; + } // In this block, returning `None` is ignored, and only means not writing nodeinfo to db async { - if res.status().is_client_error() { - return None; - } - let node_info_url = res .json::() .await