[local-sync] Increment streamAll offset by chunkSize (#5)

Otherwise we'll infinite loop if there are more than 2000 results.
This commit is contained in:
Mark Hahnenberg 2016-12-09 11:15:04 -08:00 committed by GitHub
parent 60bca4acb2
commit f32d0df7e0

View file

@ -11,7 +11,7 @@ Sequelize.Model.prototype.streamAll = function streamAll(options = {}) {
this.findAll(opts).then((models = []) => {
observer.onNext(models)
if (models.length === chunkSize) {
opts.offset = chunkSize;
opts.offset += chunkSize;
findFn(opts)
} else {
observer.onCompleted()