From eefbace91270aa2eea679df00fd626d4b3158b34 Mon Sep 17 00:00:00 2001
From: renoseven <dev@renoseven.net>
Date: Tue, 11 Feb 2025 17:29:13 +0800
Subject: [PATCH] syscared: impl 'syscare rescan' command
Signed-off-by: renoseven <dev@renoseven.net>
syscared/src/rpc/skeleton/patch.rs | 3 +++
syscared/src/rpc/skeleton_impl/patch.rs | 9 +++++++++
2 files changed, 12 insertions(+)
@@ -53,4 +53,7 @@ pub trait PatchSkeleton {
#[rpc(name = "restore_patch_status")]
fn restore_patch_status(&self, accepted_only: bool) -> RpcResult<()>;
+
+ #[rpc(name = "rescan_patches")]
+ fn rescan_patches(&self) -> RpcResult<()>;
}
@@ -234,4 +234,13 @@ impl PatchSkeleton for PatchSkeletonImpl {
.context("Failed to restore patch status")
})
}
+
+ fn rescan_patches(&self) -> RpcResult<()> {
+ RpcFunction::call(move || -> Result<()> {
+ self.patch_manager
+ .write()
+ .rescan_patches()
+ .context("Failed to rescan patches")
+ })
+ }
}
--
2.43.0