Skip to content

Commit

Permalink
Make sure to passthrough extra options to selected source
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Sep 12, 2024
1 parent 624d491 commit ddbcd60
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/load-from-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ async function processBlockReceipts(streamerMessage, { include, exclude }) {
async function loadStream(options) {
const {
startBlockHeight,
bucketName,
regionName,
endpoint,
batchSize,
limit,
updateBlockHeight,
include,
exclude,
updateBlockHeight,
source,
...otherOptions
} = options;

console.log('otherOptions', otherOptions);

const { readBlocks } = require(`fast-near/source/${source}`);

const defaultStartBlockHeight = parseInt(process.env.NEARFS_DEFAULT_START_BLOCK_HEIGHT || '0');
Expand All @@ -104,16 +104,16 @@ async function loadStream(options) {

for await (let streamerMessage of readBlocks({
startBlockHeight: start,
s3BucketName: bucketName || "near-lake-data-mainnet",
s3RegionName: regionName || "eu-central-1",
s3Endpoint: endpoint,
endBlockHeight: limit ? start + limit : undefined,
batchSize,
...otherOptions
})) {
await withTimeCounter('handleStreamerMessage', async () => {
await handleStreamerMessage(streamerMessage, {
batchSize,
updateBlockHeight,
include,
exclude,
updateBlockHeight,
});
});

Expand Down

0 comments on commit ddbcd60

Please sign in to comment.