Don't swallow indexing failures
When an error occurs in the indexer pipeline, it logs it out, and then drops it on the floor. This is problematic because externally, from the task scheduler's perspective, it appears to have succeeded, which is not true. As a result, these failures are invisible to tooling which introspects over tasks. This makes the index task promise resolve when the pipeline finishes as before, but it rejects if the pipeline failed. Signed-off-by: Charles Lowell <cowboyd@frontside.com>
This commit is contained in:
@@ -128,7 +128,7 @@ export class IndexBuilder {
|
||||
const indexer = await this.searchEngine.getIndexer(type);
|
||||
|
||||
// Compose collator/decorators/indexer into a pipeline
|
||||
return new Promise<void>(done => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
pipeline(
|
||||
[collator, ...decorators, indexer],
|
||||
(error: NodeJS.ErrnoException | null) => {
|
||||
@@ -136,12 +136,12 @@ export class IndexBuilder {
|
||||
this.logger.error(
|
||||
`Collating documents for ${type} failed: ${error}`,
|
||||
);
|
||||
reject(error);
|
||||
} else {
|
||||
// Signal index pipeline completion!
|
||||
this.logger.info(`Collating documents for ${type} succeeded`);
|
||||
resolve();
|
||||
}
|
||||
|
||||
// Signal index pipeline completion!
|
||||
done();
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user