Skip to content

Commit f16d2e0

Browse files
committed
debug: add logs
1 parent c71f020 commit f16d2e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/services/ResourceService.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ listChallengesByMember.schema = {
492492
}
493493

494494
async function searchESWithScroll (mustQuery) {
495+
console.log('searchESWithScroll')
495496
const scrollTimeout = '1m'
496497
const esQuery = {
497498
index: config.get('ES.ES_INDEX'),
@@ -508,16 +509,21 @@ async function searchESWithScroll (mustQuery) {
508509
}
509510

510511
const esClient = await helper.getESClient()
512+
console.log('searchESWithScroll: esClient.search')
511513
const searchResponse = await esClient.search(esQuery)
512514

513515
// eslint-disable-next-line camelcase
514516
const { _scroll_id, hits } = searchResponse
515517
const totalHits = hits.total
516518
// eslint-disable-next-line camelcase
519+
console.log(`_scroll_id: ${_scroll_id}`)
520+
console.log(`totalHits: ${totalHits}`)
521+
// eslint-disable-next-line camelcase
517522
let scrollId = _scroll_id
518523
let currentHits = hits.hits
519524

520525
while (currentHits.length < totalHits) {
526+
console.log(`currentHits.length: ${currentHits.length}`)
521527
const nextScrollResponse = await esClient.scroll({
522528
scroll: scrollTimeout,
523529
scroll_id: scrollId

0 commit comments

Comments
 (0)