mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 03:11:32 +00:00
Consider remote instance as dead if it returns any status 4xx or 5xx (ref #3134)
This commit is contained in:
parent
9e17c517fe
commit
74100772b4
1 changed files with 5 additions and 4 deletions
|
@ -579,13 +579,13 @@ async fn build_update_instance_form(
|
||||||
// This is the only kind of error that means the instance is dead
|
// This is the only kind of error that means the instance is dead
|
||||||
return None;
|
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
|
// In this block, returning `None` is ignored, and only means not writing nodeinfo to db
|
||||||
async {
|
async {
|
||||||
if res.status().is_client_error() {
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
let node_info_url = res
|
let node_info_url = res
|
||||||
.json::<NodeInfoWellKnown>()
|
.json::<NodeInfoWellKnown>()
|
||||||
.await
|
.await
|
||||||
|
@ -617,6 +617,7 @@ async fn build_update_instance_form(
|
||||||
}
|
}
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
dbg!("reach here?");
|
||||||
Some(instance_form)
|
Some(instance_form)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue