Idle detector: Fix bug preventing it from ever turning off (#2487)
This commit is contained in:
parent
bd13939548
commit
125c3fafa8
2 changed files with 11 additions and 3 deletions
|
@ -78,6 +78,7 @@
|
|||
let isMigrationWithIndexComplete = false;
|
||||
let isMigrationWithoutIndexComplete = false;
|
||||
idleDetector.on('idle', async () => {
|
||||
console.log('Idle processing started');
|
||||
const NUM_MESSAGES_PER_BATCH = 1;
|
||||
|
||||
if (!isMigrationWithIndexComplete) {
|
||||
|
@ -108,6 +109,7 @@
|
|||
const areAllMigrationsComplete =
|
||||
isMigrationWithIndexComplete && isMigrationWithoutIndexComplete;
|
||||
if (areAllMigrationsComplete) {
|
||||
console.log('All migrations are complete. Stopping idle detector.');
|
||||
idleDetector.stop();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue