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
|
||||
|
||||
this.bulkIndexationTimer = setTimeout(async () => {
|
||||
try {
|
||||
const elements = this.elementsToBulkIndex
|
||||
this.elementsToBulkIndex = []
|
||||
const elements = this.elementsToBulkIndex
|
||||
this.elementsToBulkIndex = []
|
||||
|
||||
try {
|
||||
logger.info(`Bulk indexing ${elements.length} elements in ${this.indexName}`)
|
||||
|
||||
this.bulkProcessEnqueuedTask = await this.indexElements(elements)
|
||||
} catch (err) {
|
||||
logger.error({ err }, 'Cannot schedule bulk indexation')
|
||||
logger.error({ err, elements }, 'Cannot schedule bulk indexation')
|
||||
} finally {
|
||||
this.bulkIndexationTimer = undefined
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue