Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('CSV Execute Job', function () {
);

expect(mockEsClient.scroll).toHaveBeenCalledWith(
expect.objectContaining({ scroll_id: scrollId })
expect.objectContaining({ body: { scroll_id: scrollId } })
);
});

Expand Down Expand Up @@ -261,7 +261,7 @@ describe('CSV Execute Job', function () {
);

expect(mockEsClient.clearScroll).toHaveBeenCalledWith(
expect.objectContaining({ scroll_id: lastScrollId })
expect.objectContaining({ body: { scroll_id: lastScrollId } })
);
});

Expand Down Expand Up @@ -295,7 +295,7 @@ describe('CSV Execute Job', function () {
);

expect(mockEsClient.clearScroll).toHaveBeenCalledWith(
expect.objectContaining({ scroll_id: lastScrollId })
expect.objectContaining({ body: { scroll_id: lastScrollId } })
);
});
});
Expand Down Expand Up @@ -753,7 +753,7 @@ describe('CSV Execute Job', function () {

expect(mockEsClient.clearScroll).toHaveBeenCalledWith(
expect.objectContaining({
scroll_id: scrollId,
body: { scroll_id: scrollId },
})
);
});
Expand Down Expand Up @@ -1150,7 +1150,7 @@ describe('CSV Execute Job', function () {
await runTask('job123', jobParams, cancellationToken);

expect(mockEsClient.scroll).toHaveBeenCalledWith(
expect.objectContaining({ scroll: scrollDuration })
expect.objectContaining({ body: { scroll: scrollDuration, scroll_id: 'scrollId' } })
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ export function createHitIterator(logger: LevelLogger) {
);
}

async function scroll(scrollId: string | undefined) {
async function scroll(scrollId: string) {
logger.debug('executing scroll request');
return parseResponse(
await elasticsearchClient.scroll({
scroll_id: scrollId,
scroll: scrollSettings.duration,
body: {
scroll_id: scrollId,
scroll: scrollSettings.duration,
},
})
);
}
Expand All @@ -74,7 +76,7 @@ export function createHitIterator(logger: LevelLogger) {
logger.debug('executing clearScroll request');
try {
await elasticsearchClient.clearScroll({
scroll_id: scrollId,
body: { scroll_id: scrollId },
});
} catch (err) {
// Do not throw the error, as the job can still be completed successfully
Expand Down