Skip to content

Commit

Permalink
fix: re-add 0.10 settings migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezs authored and dandanlen committed Oct 17, 2023
1 parent cbe21be commit 9f83f25
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions engine/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use clap::Parser;
use futures::FutureExt;
use multisig::{self, bitcoin::BtcSigning, eth::EthSigning, polkadot::PolkadotSigning};
use std::{
path::PathBuf,
sync::{atomic::AtomicBool, Arc},
time::Duration,
};
Expand Down Expand Up @@ -147,6 +148,21 @@ async fn main() -> anyhow::Result<()> {
// Wait until SCC has started, to ensure old engine has stopped
start_logger_server_fn.take().expect("only called once")(scope);

if *CFE_VERSION == (SemVer { major: 0, minor: 10, patch: 0 }) &&
settings_dir != DEFAULT_SETTINGS_DIR
{
// Effectively, we want to move the files from the temp-migrated location, to
// the standard location
// - updating it in-place.
// Note: the backup was already created and is in the temp folder (which will
// become the new standard folder) too
std::fs::rename(
config_root_path.join(settings_dir),
config_root_path.join(DEFAULT_SETTINGS_DIR),
)
.context("Unable to replace old settings with temp settings")?;
}

if let Some(health_check_settings) = &settings.health_check {
health::start(scope, health_check_settings, has_completed_initialising.clone())
.await?;
Expand Down

0 comments on commit 9f83f25

Please sign in to comment.