From 73909ffe4057b97884e912df3148a33d2dcfc225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Tue, 26 Sep 2023 12:02:23 +0100 Subject: [PATCH 1/2] Wait before probing --- rust/agama-lib/src/manager.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rust/agama-lib/src/manager.rs b/rust/agama-lib/src/manager.rs index 640fd5b533..3a3d25ac6e 100644 --- a/rust/agama-lib/src/manager.rs +++ b/rust/agama-lib/src/manager.rs @@ -28,6 +28,7 @@ impl<'a> ManagerClient<'a> { } pub async fn probe(&self) -> Result<(), ServiceError> { + self.wait().await?; Ok(self.manager_proxy.probe().await?) } @@ -55,12 +56,12 @@ impl<'a> ManagerClient<'a> { /// Waits until the manager is idle. pub async fn wait(&self) -> Result<(), ServiceError> { + let mut stream = self.status_proxy.receive_current_changed().await; if !self.is_busy().await { return Ok(()); } - let mut s = self.status_proxy.receive_current_changed().await; - while let Some(change) = s.next().await { + while let Some(change) = stream.next().await { if change.get().await? == 0 { return Ok(()); } From f00379f00e26afd444708383f0f6b75722728ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Tue, 26 Sep 2023 13:11:30 +0100 Subject: [PATCH 2/2] Update the changes file --- rust/package/agama-cli.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rust/package/agama-cli.changes b/rust/package/agama-cli.changes index 2d0a7d2554..cf993f37d6 100644 --- a/rust/package/agama-cli.changes +++ b/rust/package/agama-cli.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Sep 26 12:05:52 UTC 2023 - Imobach Gonzalez Sosa + +- Wait until the manager is ready before probing + (gh#openSUSE/agama#771). + ------------------------------------------------------------------- Mon Sep 25 11:32:53 UTC 2023 - Imobach Gonzalez Sosa