Log elements when cannot bulk index
This commit is contained in:
parent
fa11e5c655
commit
8eb43d3686
|
@ -105,15 +105,15 @@ export abstract class AbstractIndexer <T extends IndexableDoc, DB> {
|
||||||
if (this.bulkIndexationTimer) return
|
if (this.bulkIndexationTimer) return
|
||||||
|
|
||||||
this.bulkIndexationTimer = setTimeout(async () => {
|
this.bulkIndexationTimer = setTimeout(async () => {
|
||||||
try {
|
|
||||||
const elements = this.elementsToBulkIndex
|
const elements = this.elementsToBulkIndex
|
||||||
this.elementsToBulkIndex = []
|
this.elementsToBulkIndex = []
|
||||||
|
|
||||||
|
try {
|
||||||
logger.info(`Bulk indexing ${elements.length} elements in ${this.indexName}`)
|
logger.info(`Bulk indexing ${elements.length} elements in ${this.indexName}`)
|
||||||
|
|
||||||
this.bulkProcessEnqueuedTask = await this.indexElements(elements)
|
this.bulkProcessEnqueuedTask = await this.indexElements(elements)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error({ err }, 'Cannot schedule bulk indexation')
|
logger.error({ err, elements }, 'Cannot schedule bulk indexation')
|
||||||
} finally {
|
} finally {
|
||||||
this.bulkIndexationTimer = undefined
|
this.bulkIndexationTimer = undefined
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue