Skip to content

Commit

Permalink
pr feedback: bubble write_batch error to caller
Browse files Browse the repository at this point in the history
  • Loading branch information
AshwinSekar committed Feb 28, 2024
1 parent a6bcc31 commit 4a95caa
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions ledger/src/blockstore/blockstore_purge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ impl Blockstore {
let Some(mut slot_meta) = self.meta(slot)? else {
return Err(BlockstoreError::SlotUnavailable);
};
let mut write_batch = self
.db
.batch()
.expect("Database Error: Failed to get write batch");
let mut write_batch = self.db.batch()?;

let columns_purged = self.purge_range(&mut write_batch, slot, slot, PurgeType::Exact)?;

Expand Down Expand Up @@ -209,10 +206,7 @@ impl Blockstore {
purge_type: PurgeType,
purge_stats: &mut PurgeStats,
) -> Result<bool> {
let mut write_batch = self
.db
.batch()
.expect("Database Error: Failed to get write batch");
let mut write_batch = self.db.batch()?;

let mut delete_range_timer = Measure::start("delete_range");
let columns_purged = self.purge_range(&mut write_batch, from_slot, to_slot, purge_type)?;
Expand Down

0 comments on commit 4a95caa

Please sign in to comment.