Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Update comment in pull_missing_blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
albrow committed Dec 18, 2018
1 parent 40ad305 commit 7889a03
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/pipeline/src/scripts/pull_missing_blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ async function getAllMissingBlocksAsync(web3Source: Web3Source, tableName: strin
}

async function getMissingBlockNumbersAsync(tableName: string): Promise<number[]> {
// Note(albrow): The easiest way to get all the blocks we need is to
// consider all the events tables together in a single query. If this query
// gets too slow, we should consider re-architecting so that we can work on
// getting the blocks for one type of event at a time.
// This query returns up to `MAX_BLOCKS_PER_QUERY` distinct block numbers
// which are present in `tableName` but not in `raw.blocks`.
const response = (await connection.query(
`SELECT DISTINCT(block_number) FROM ${tableName} LEFT JOIN raw.blocks ON ${tableName}.block_number = raw.blocks.number WHERE number IS NULL LIMIT $1;`,
[MAX_BLOCKS_PER_QUERY],
Expand Down

0 comments on commit 7889a03

Please sign in to comment.