Skip to content

Commit

Permalink
Reset create_canister_block_index after creating canister
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles committed Dec 18, 2024
1 parent 1063359 commit 39d87d0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions backend/canisters/registry/impl/src/timer_job_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ async fn create_canister(
}
};

cycles_minting_canister_c2c_client::notify_create_canister(
match cycles_minting_canister_c2c_client::notify_create_canister(
cmc,
&cycles_minting_canister::notify_create_canister::Args {
block_index,
Expand All @@ -279,5 +279,18 @@ async fn create_canister(
},
)
.await?
.map_err(|error| (RejectionCode::Unknown, format!("{error:?}")))
{
Ok(canister_id) => {
if create_canister_block_index.is_some() {
mutate_state(|state| {
state
.data
.subnets
.update_in_progress(|s| s.create_canister_block_index = None, now)
});
}
Ok(canister_id)
}
Err(error) => Err((RejectionCode::Unknown, format!("{error:?}"))),
}
}

0 comments on commit 39d87d0

Please sign in to comment.