Skip to content

Commit

Permalink
Avoid making c2c call in post_upgrade (#5421)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Feb 21, 2024
1 parent d5e85b7 commit 6478f7e
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::lifecycle::{init_env, init_state};
use crate::memory::get_upgrades_memory;
use crate::{mutate_state, Data};
use crate::{jobs, mutate_state, Data};
use canister_logger::LogEntry;
use canister_tracing_macros::trace;
use ic_cdk_macros::post_upgrade;
Expand Down Expand Up @@ -38,6 +38,10 @@ fn post_upgrade(args: Args) {
crate::jobs::sync_legacy_user_principals::start_job_if_required(state);
}

state.push_event_to_all_local_user_indexes(Event::SecretKeySet(state.data.oc_key_pair.secret_key_der().to_vec()), None);
let event = Event::SecretKeySet(state.data.oc_key_pair.secret_key_der().to_vec());
for canister_id in state.data.local_index_map.canisters() {
state.data.user_index_event_sync_queue.push(*canister_id, event.clone());
}
jobs::sync_events_to_local_user_index_canisters::start_job_if_required(state);
});
}

0 comments on commit 6478f7e

Please sign in to comment.