mirror of
https://github.com/harivansh-afk/deskctl.git
synced 2026-04-15 09:01:15 +00:00
grouped runtime reads and waits selector modes (#5)
- grouped runtime reads and waits selector modes - Fix wait command client timeouts and test failures
This commit is contained in:
parent
cc8f8e548a
commit
a4cf9e32dd
12 changed files with 1323 additions and 77 deletions
|
|
@ -21,6 +21,13 @@ pub fn env_lock() -> &'static Mutex<()> {
|
|||
LOCK.get_or_init(|| Mutex::new(()))
|
||||
}
|
||||
|
||||
pub fn env_lock_guard() -> std::sync::MutexGuard<'static, ()> {
|
||||
match env_lock().lock() {
|
||||
Ok(guard) => guard,
|
||||
Err(poisoned) => poisoned.into_inner(),
|
||||
}
|
||||
}
|
||||
|
||||
pub struct SessionEnvGuard {
|
||||
old_session_type: Option<String>,
|
||||
}
|
||||
|
|
@ -218,3 +225,7 @@ pub fn successful_json_response(output: Output) -> Result<serde_json::Value> {
|
|||
|
||||
serde_json::from_slice(&output.stdout).context("Failed to parse JSON output from deskctl")
|
||||
}
|
||||
|
||||
pub fn json_response(output: &Output) -> Result<serde_json::Value> {
|
||||
serde_json::from_slice(&output.stdout).context("Failed to parse JSON output from deskctl")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue