Skip to content

Commit 7668da0

Browse files
committed
Always set OnlineStatus::Offline if dir fails
We don't really care about the exact reason, and the codes can't be trusted anyway (some brokers return 8).
1 parent 2ebb90a commit 7668da0

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "historyprovider"
33
description = "historyprovider-rs"
44
license = "MIT"
55
repository = "https://github.com/silicon-heaven/historyprovider-rs"
6-
version = "2.3.7"
6+
version = "2.4.0"
77
edition = "2024"
88

99
[[bin]]

src/sites.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,7 @@ fn online_status_worker(
300300
.await;
301301
if dir_result.is_ok() {
302302
set_online_status(&site, SiteOnlineStatus::Online, &client_commands, &app_state).await;
303-
} else if let Err(err) = dir_result
304-
&& let CallRpcMethodErrorKind::RpcError(RpcError { code, .. }) = err.error()
305-
&& (*code == RpcErrorCode::MethodCallTimeout.into() || *code == RpcErrorCode::MethodNotFound.into())
306-
{
303+
} else if let Err(err) = dir_result && matches!(err.error(), CallRpcMethodErrorKind::RpcError(RpcError { .. })) {
307304
set_online_status(&site, SiteOnlineStatus::Offline, &client_commands, &app_state).await;
308305
}
309306
}

0 commit comments

Comments
 (0)