Skip to content

Commit

Permalink
remove get_range from the Queue and Writer
Browse files Browse the repository at this point in the history
  • Loading branch information
zorancv committed Nov 15, 2024
1 parent 9acd51e commit e25e9bf
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions store/postgres/src/writable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,14 +1228,6 @@ impl Queue {
Ok(map)
}

fn get_range(
&self,
entity_type: &EntityType,
block_range: Range<BlockNumber>,
) -> Result<BTreeMap<BlockNumber, Vec<Entity>>, StoreError> {
self.store.get_range(entity_type, block_range)
}

fn get_derived(
&self,
derived_query: &DerivedEntityQuery,
Expand Down Expand Up @@ -1448,17 +1440,6 @@ impl Writer {
}
}

fn get_range(
&self,
entity_type: &EntityType,
block_range: Range<BlockNumber>,
) -> Result<BTreeMap<BlockNumber, Vec<Entity>>, StoreError> {
match self {
Writer::Sync(store) => store.get_range(entity_type, block_range),
Writer::Async { queue, .. } => queue.get_range(entity_type, block_range),
}
}

fn get_derived(
&self,
key: &DerivedEntityQuery,
Expand Down Expand Up @@ -1587,12 +1568,14 @@ impl ReadStore for WritableStore {
self.writer.get_many(keys)
}

// The entities that are returned are only the ones from the database.
// The ones in the queue are ignored.
fn get_range(
&self,
entity_type: &EntityType,
block_range: Range<BlockNumber>,
) -> Result<BTreeMap<BlockNumber, Vec<Entity>>, StoreError> {
self.writer.get_range(entity_type, block_range)
self.store.get_range(entity_type, block_range)
}

fn get_derived(
Expand Down

0 comments on commit e25e9bf

Please sign in to comment.