Skip to content

Commit e430e7b

Browse files
authored
Merge pull request #63 from silicon-heaven/fix-online-status
Always set OnlineStatus::Offline if dir fails
2 parents 2ebb90a + 399519f commit e430e7b

3 files changed

Lines changed: 4 additions & 7 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: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use shvclient::clientapi::{CallRpcMethodErrorKind, RpcCall, RpcCallDirExists, Rp
1010
use shvclient::clientnode::{METH_DIR, SIG_CHNG};
1111
use shvclient::{ClientCommandSender, ClientEventsReceiver};
1212
use shvproto::{DateTime, RpcValue};
13-
use shvrpc::rpcmessage::{RpcError, RpcErrorCode};
13+
use shvrpc::rpcmessage::RpcError;
1414
use shvrpc::util::find_longest_path_prefix;
1515
use shvrpc::{join_path, RpcMessageMetaTags};
1616
use tokio::time::timeout;
@@ -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)