wait for initialize to complete before finalize
Signed-off-by: Brian Fletcher <brian@roadie.io>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-search-backend-node': patch
|
||||
---
|
||||
|
||||
Wait for indexer initialization before finalizing indexing.
|
||||
@@ -110,6 +110,11 @@ export abstract class BatchSearchEngineIndexer extends Writable {
|
||||
* @internal
|
||||
*/
|
||||
async _final(done: (error?: Error | null) => void) {
|
||||
const maybeError = await this.initialized;
|
||||
if (maybeError) {
|
||||
done(maybeError);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// Index any remaining documents.
|
||||
if (this.currentBatch.length) {
|
||||
|
||||
Reference in New Issue
Block a user