Skip to content

Commit

Permalink
due cleanup (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham8287 committed May 27, 2024
1 parent 55b7cbe commit 1f23316
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
17 changes: 2 additions & 15 deletions crates/core/src/db/datastore/locking_tx_datastore/datastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,19 +1179,6 @@ mod tests {
.collect()
}

//TODO(shub), begin_tx is not yet implemented for Tx, creating this utility for tests.
fn begin_tx(db: &Locking) -> TxId {
let timer = Instant::now();

let committed_state_shared_lock = db.committed_state.read_arc();
let lock_wait_time = timer.elapsed();
TxId {
committed_state_shared_lock,
lock_wait_time,
timer,
}
}

fn all_rows_tx(tx: &TxId, table_id: TableId) -> Vec<ProductValue> {
tx.iter(&ExecutionContext::default(), table_id)
.unwrap()
Expand Down Expand Up @@ -1837,8 +1824,8 @@ mod tests {
datastore.commit_mut_tx_for_test(tx)?;

// create multiple read only tx, and use them together.
let read_tx_1 = begin_tx(&datastore);
let read_tx_2 = begin_tx(&datastore);
let read_tx_1 = datastore.begin_tx();
let read_tx_2 = datastore.begin_tx();
let rows = &[row1, row2];
assert_eq!(&all_rows_tx(&read_tx_2, table_id), rows);
assert_eq!(&all_rows_tx(&read_tx_1, table_id), rows);
Expand Down
1 change: 0 additions & 1 deletion crates/core/src/subscription/module_subscription_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ impl ModuleSubscriptions {
let tx = scopeguard::guard(self.relational_db.begin_tx(), |tx| {
self.relational_db.release_tx(&ctx, tx);
});
// check for backward comp.
let request_id = subscription.request_id;
let auth = AuthCtx::new(self.owner_identity, sender.id.identity);
let mut queries = vec![];
Expand Down

0 comments on commit 1f23316

Please sign in to comment.