| 1148 | } |
| 1149 | |
| 1150 | fn print_lifecycle(lifecycle: &ManagedLifecycle, json: bool) -> CliResult<()> { |
| 1151 | if json { |
| 1152 | println!("{}", serde_json::to_string(lifecycle).unwrap()); |
| 1153 | } else { |
| 1154 | println!( |
| 1155 | "Managed run {}: owner={} session={} view={} workdir={} expires_at={}", |
| 1156 | lifecycle.run_id, |
| 1157 | lifecycle.owner_agent, |
| 1158 | lifecycle.owner_session_id, |
| 1159 | lifecycle.view.as_deref().unwrap_or("-"), |
| 1160 | lifecycle.workdir.display(), |
| 1161 | lifecycle.expires_at, |
| 1162 | ); |
| 1163 | } |
| 1164 | Ok(()) |
| 1165 | } |
| 1166 | |
| 1167 | fn now_secs() -> i64 { |
| 1168 | chrono::Utc::now().timestamp() |