idle: afk command, configurable session timeout, fix block_reason
Add `poc-daemon afk` to immediately mark Kent as away, allowing the idle timer to fire without waiting for the session active timeout. Add `poc-daemon session-timeout <secs>` to configure how long after the last message Kent counts as "present" (default 15min, persisted). Fix block_reason() to report "kent present" and "in turn" states that were checked in the tick but not in the diagnostic output.
This commit is contained in:
parent
05e0f1d5be
commit
55fdc3dad7
4 changed files with 66 additions and 2 deletions
|
|
@ -84,6 +84,13 @@ enum Command {
|
|||
/// Duration in seconds
|
||||
seconds: Option<u32>,
|
||||
},
|
||||
/// Mark Kent as AFK (immediately allow idle timer to fire)
|
||||
Afk,
|
||||
/// Set session active timeout in seconds (how long after last message Kent counts as "present")
|
||||
SessionTimeout {
|
||||
/// Timeout in seconds
|
||||
seconds: f64,
|
||||
},
|
||||
/// Set idle timeout in seconds (how long before autonomous prompt)
|
||||
IdleTimeout {
|
||||
/// Timeout in seconds
|
||||
|
|
@ -249,6 +256,16 @@ async fn client_main(cmd: Command) -> Result<(), Box<dyn std::error::Error>> {
|
|||
req.get().set_seconds(seconds.unwrap_or(300));
|
||||
req.send().promise.await?;
|
||||
}
|
||||
Command::Afk => {
|
||||
daemon.afk_request().send().promise.await?;
|
||||
println!("marked AFK");
|
||||
}
|
||||
Command::SessionTimeout { seconds } => {
|
||||
let mut req = daemon.session_timeout_request();
|
||||
req.get().set_seconds(seconds);
|
||||
req.send().promise.await?;
|
||||
println!("session timeout = {seconds}s");
|
||||
}
|
||||
Command::IdleTimeout { seconds } => {
|
||||
let mut req = daemon.idle_timeout_request();
|
||||
req.get().set_seconds(seconds);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue