Skip to content
This repository was archived by the owner on Aug 12, 2023. It is now read-only.

Commit 4a48642

Browse files
authored
Add query option to bulk indexing job (#395)
1 parent 0c56ee1 commit 4a48642

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/consumers/bulk-index-fills.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const fillsIndex = require('../index/fills');
1111
const logger = signale.scope('bulk index fills');
1212

1313
const bulkIndexFills = async job => {
14-
const { batchSize } = job.data;
14+
const { batchSize, query } = job.data;
1515

1616
if (!_.isFinite(batchSize) || batchSize <= 0) {
1717
throw new Error(`Invalid batchSize: ${batchSize}`);
@@ -20,8 +20,9 @@ const bulkIndexFills = async job => {
2020
const nextBatch = await getModel('Fill')
2121
.find(
2222
job.data.lastFillId === undefined
23-
? undefined
23+
? query
2424
: {
25+
...JOB(query || {}),
2526
_id: { $gt: job.data.lastFillId },
2627
},
2728
'_id',

0 commit comments

Comments
 (0)