Ensure pushStatus is properly running (#7213)
* Ensure pushStatus is properly running * remove duplicate test
This commit is contained in:
@@ -79,19 +79,6 @@ describe('PushController', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can throw on validateDeviceType when single invalid device type is set', done => {
|
|
||||||
// Make query condition
|
|
||||||
const where = {
|
|
||||||
deviceType: 'osx',
|
|
||||||
};
|
|
||||||
const validPushTypes = ['ios', 'android'];
|
|
||||||
|
|
||||||
expect(function () {
|
|
||||||
validatePushType(where, validPushTypes);
|
|
||||||
}).toThrow();
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('can get expiration time in string format', done => {
|
it('can get expiration time in string format', done => {
|
||||||
// Make mock request
|
// Make mock request
|
||||||
const timeStr = '2015-03-19T22:05:08Z';
|
const timeStr = '2015-03-19T22:05:08Z';
|
||||||
|
|||||||
@@ -314,6 +314,7 @@ describe('PushWorker', () => {
|
|||||||
amount: 1,
|
amount: 1,
|
||||||
},
|
},
|
||||||
count: { __op: 'Increment', amount: -1 },
|
count: { __op: 'Increment', amount: -1 },
|
||||||
|
status: 'running',
|
||||||
});
|
});
|
||||||
const query = new Parse.Query('_PushStatus');
|
const query = new Parse.Query('_PushStatus');
|
||||||
return query.get(handler.objectId, { useMasterKey: true });
|
return query.get(handler.objectId, { useMasterKey: true });
|
||||||
@@ -409,6 +410,7 @@ describe('PushWorker', () => {
|
|||||||
amount: 1,
|
amount: 1,
|
||||||
},
|
},
|
||||||
count: { __op: 'Increment', amount: -1 },
|
count: { __op: 'Increment', amount: -1 },
|
||||||
|
status: 'running',
|
||||||
});
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -295,9 +295,8 @@ export function pushStatusHandler(config, existingObjectId) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// indicate this batch is complete
|
|
||||||
incrementOp(update, 'count', -1);
|
incrementOp(update, 'count', -1);
|
||||||
|
update.status = 'running';
|
||||||
|
|
||||||
return handler.update({ objectId }, update).then(res => {
|
return handler.update({ objectId }, update).then(res => {
|
||||||
if (res && res.count === 0) {
|
if (res && res.count === 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user