Fix for _PushStatus Stuck 'running' when Count is Off (#4319)

* Fix for _PushStatus stuck 'running' if count is off

* use 'count' for batches

* push worker test fix
This commit is contained in:
Benjamin Wilson Friedman
2017-11-05 10:04:46 -08:00
committed by Florent Vilmart
parent 842343a1a9
commit c1a7347143
5 changed files with 276 additions and 9 deletions

View File

@@ -40,7 +40,7 @@ export class PushQueue {
if (!results || count == 0) {
return Promise.reject({error: 'PushController: no results in query'})
}
pushStatus.setRunning(count);
pushStatus.setRunning(Math.ceil(count / limit));
let skip = 0;
while (skip < count) {
const query = { where,