EventIndex: Cancel the crawler early after a message request.

If we're cancelling the crawler nowadays this means that we're likely
deleting the index. Processing these messages is wasted effort in that
case so break early.
pull/21833/head
Damir Jelić 2020-01-24 11:46:46 +01:00
parent ffe5d411db
commit 0c3d507455
1 changed files with 5 additions and 0 deletions

View File

@ -266,6 +266,11 @@ export default class EventIndex extends EventEmitter {
continue;
}
if (cancelled) {
this.crawlerCheckpoints.push(checkpoint);
break;
}
if (res.chunk.length === 0) {
console.log("EventIndex: Done with the checkpoint", checkpoint);
// We got to the start/end of our timeline, lets just