includes/spoolchanges.js
function(lastOne) {
    if (buffer.length >= bufferSize || (lastOne && buffer.length > 0)) {
      debug('writing', buffer.length, 'changes to the backup file');
      var b = { docs: buffer.splice(0, bufferSize), batch: batch };
      logStream.write(':t batch' + batch + ' ' + JSON.stringify(b.docs) + '\n');
      ee.emit('changes', batch);
      batch++;
    }
  }
function(lastOne) {
    if (buffer.length >= bufferSize || (lastOne && buffer.length > 0)) {
      debug('writing', buffer.length, 'changes to the backup file');
      var b = { docs: buffer.splice(0, bufferSize), batch: batch };
      logStream.write(':t batch' + batch + ' ' + JSON.stringify(b.docs) + '\n');
      ee.emit('changes', batch);
      batch++;
    }
  }
function ( lastOne ) { if ( buffer . length >= bufferSize || ( lastOne && buffer . length > 0 ) ) { debug ( 'writing' , buffer . length , 'changes to the backup file' ) ; var b = { docs : buffer . splice ( 0 , bufferSize ) , batch : batch } ; logStream . write ( ':t batch' + batch + ' ' + JSON . stringify ( b . docs ) + '\n' ) ; ee . emit ( 'changes' , batch ) ; batch ++ ; } }
send documents ids to the queue in batches of bufferSize + the last batch
send documents ids to the queue in batches of bufferSize + the last batch