Skip to content

Commit

Permalink
Recreate rocksdb
Browse files Browse the repository at this point in the history
Signed-off-by: Danil <[email protected]>
  • Loading branch information
Deniallugo committed Jun 25, 2024
1 parent 4cf13d0 commit d196cc6
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use crate::{
MSG_CHAIN_NOT_INITIALIZED, MSG_FAILED_TO_DROP_SERVER_DATABASE_ERR,
MSG_INITIALIZING_DATABASES_SPINNER,
},
utils::rocks_db::{recreate_rocksdb_dirs, RocksDBDirOption},
};

pub async fn run(shell: &Shell) -> anyhow::Result<()> {
Expand Down Expand Up @@ -40,6 +41,11 @@ pub async fn init(shell: &Shell, chain_config: &ChainConfig) -> anyhow::Result<(
.await
.context(MSG_FAILED_TO_DROP_SERVER_DATABASE_ERR)?;
init_db(&db_config).await?;
recreate_rocksdb_dirs(
shell,
&chain_config.rocks_db_path,
RocksDBDirOption::ExternalNode,
)?;
let path_to_server_migration = chain_config.link_to_code.join(SERVER_MIGRATIONS);
migrate_db(shell, path_to_server_migration, &db_config.full_url()).await?;
spin.finish();
Expand Down

0 comments on commit d196cc6

Please sign in to comment.