Skip to content

Commit

Permalink
add package.rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bonez committed Sep 26, 2024
1 parent 1c6fa78 commit e49854d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/startos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ pub fn package<C: Context>() -> ParentHandler<C> {
.no_display()
.with_call_remote::<CliContext>(),
)
.subcommand(
"rebuild",
from_fn_async(service::rebuild)
.with_metadata("sync_db", Value::Bool(true))
.no_display()
.with_call_remote::<CliContext>(),
)
.subcommand("logs", logs::package_logs())
.subcommand(
"logs",
Expand Down
9 changes: 9 additions & 0 deletions core/startos/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,15 @@ impl ServiceActorSeed {
}
}

#[derive(Deserialize, Serialize, Parser, TS)]
pub struct RebuildParams {
pub id: PackageId,
}
pub async fn rebuild(ctx: RpcContext, RebuildParams { id }: RebuildParams) -> Result<(), Error> {
ctx.services.load(&ctx, &id, LoadDisposition::Retry).await?;
Ok(())
}

#[derive(Deserialize, Serialize, Parser, TS)]
pub struct ConnectParams {
pub id: PackageId,
Expand Down

0 comments on commit e49854d

Please sign in to comment.