Skip to content

Commit d8ba7e4

Browse files
committed
node: Clean up change-shard output
1 parent a4cd243 commit d8ba7e4

1 file changed

Lines changed: 4 additions & 22 deletions

File tree

node/src/manager/commands/chain.rs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ pub async fn change_block_cache_shard(
261261
.await
262262
.ok_or_else(|| anyhow!("unknown chain: {}", &chain_name))?;
263263
let ident = chain_store.chain_identifier().await?;
264-
let target_shard = Shard::new(shard.clone())?;
264+
let target_shard = Shard::new(shard)?;
265265

266266
let reuse_existing_backup = match existing_backup.as_ref() {
267267
None => false,
@@ -310,14 +310,11 @@ pub async fn change_block_cache_shard(
310310
None
311311
};
312312

313-
let allocated_chain = if reuse_existing_backup {
314-
None
315-
} else {
313+
if !reuse_existing_backup {
316314
let chain =
317315
BlockStore::allocate_chain(&mut conn, &chain_name, &target_shard, &ident).await?;
318316
store.add_chain_store(&chain, true).await?;
319-
Some(chain)
320-
};
317+
}
321318

322319
let temp_backup_name = format!("{chain_name}-old-temp");
323320
if reuse_existing_backup && find_chain(&mut conn, &temp_backup_name).await?.is_some() {
@@ -366,23 +363,8 @@ pub async fn change_block_cache_shard(
366363

367364
println!(
368365
"Changed block cache shard for {} from {} to {}",
369-
chain_name, old_shard, shard
366+
chain_name, old_shard, target_shard
370367
);
371-
println!("Latest backup recorded as `{}`", canonical_backup_name);
372-
373-
if reuse_existing_backup {
374-
println!(
375-
"Reused existing backup `{}` as the active `{}` chain",
376-
canonical_backup_name, chain_name
377-
);
378-
}
379-
380-
if allocated_chain.is_some() {
381-
println!(
382-
"Allocated new chain state for `{}` on shard {}",
383-
chain_name, shard
384-
);
385-
}
386368

387369
Ok(())
388370
}

0 commit comments

Comments
 (0)