Skip to content

Commit ab80e4b

Browse files
committed
teliod: Add isAlive command for runtime query
1 parent 337adb1 commit ab80e4b

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

clis/teliod/src/command_listener.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ impl CommandListener {
8888
TeliodError::CommandFailed(ClientCmd::QuitDaemon)
8989
})
9090
}
91+
ClientCmd::IsAlive => Ok(CommandResponse::Ok),
9192
}
9293
}
9394

clis/teliod/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const TIMEOUT_SEC: u64 = 1;
3737
enum ClientCmd {
3838
#[clap(about = "Retrieve the status report")]
3939
GetStatus,
40+
#[clap(about = "Query if daemon is running")]
41+
IsAlive,
4042
#[clap(about = "Stop daemon execution")]
4143
QuitDaemon,
4244
}

clis/teliod/src/qnap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub(crate) fn handle_request(request: Request) -> Response {
6161
}
6262

6363
fn is_teliod_running() -> bool {
64-
matches!(teliod_blocking_query!(ClientCmd::GetStatus), Ok(Ok(_)))
64+
matches!(teliod_blocking_query!(ClientCmd::IsAlive), Ok(Ok(_)))
6565
}
6666

6767
fn shutdown_teliod() -> Result<(), TeliodError> {

0 commit comments

Comments
 (0)