set_status: consolidate whoami into get_agent_meta with optional name
This commit is contained in:
parent
77fdaf0d1e
commit
73871f18c3
10 changed files with 118 additions and 204 deletions
|
|
@ -187,7 +187,7 @@ fn is_rate_limited(name: &str) -> bool {
|
|||
|
||||
/// Read the agent's free-text status and the Unix timestamp when it was last set
|
||||
/// (derived from the file's mtime). Returns `(None, None)` when the file is absent
|
||||
/// or empty. `pub` so `agent_server` and `manager_server` can populate `Whoami`.
|
||||
/// or empty. `pub` so `agent_server` and `manager_server` can populate `AgentMeta`.
|
||||
pub fn read_agent_status(name: &str) -> (Option<String>, Option<i64>) {
|
||||
let path = Coordinator::agent_notes_dir(name).join("hyperhive-status");
|
||||
let meta = std::fs::metadata(&path).ok();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue