mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-22 09:18:15 +00:00
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
This commit is contained in:
parent
8a5daeec97
commit
2467a0af12
|
@ -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;
|
||||
};
|
||||
|
||||
// In this block, returning `None` is ignored, and only means not writing nodeinfo to db
|
||||
async {
|
||||
if res.status().is_client_error() {
|
||||
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 {
|
||||
let node_info_url = res
|
||||
.json::<NodeInfoWellKnown>()
|
||||
.await
|
||||
|
|
Loading…
Reference in a new issue