Skip to content

Commit 641ec2e

Browse files
committed
Clean up
1 parent 606acda commit 641ec2e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/EventuallyQueue.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,14 @@ const EventuallyQueue = {
308308
}
309309
polling = setInterval(() => {
310310
const RESTController = CoreManager.getRESTController();
311-
RESTController.request('GET', 'health/')
312-
.then(() => {
313-
this.stopPoll();
314-
return this.sendQueue();
311+
RESTController.request('GET', 'health')
312+
.then(({ status }) => {
313+
if (status === 'ok') {
314+
this.stopPoll();
315+
return this.sendQueue();
316+
}
315317
})
316-
.catch(() => {
317-
// 'Unable to connect to the Parse API' keep polling
318-
});
318+
.catch(e => e);
319319
}, ms);
320320
},
321321

src/__tests__/EventuallyQueue-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ describe('EventuallyQueue', () => {
406406

407407
it('can poll server', async () => {
408408
jest.spyOn(EventuallyQueue, 'sendQueue').mockImplementationOnce(() => {});
409-
RESTController._setXHR(mockXHR([{ status: 200, response: {} }]));
409+
RESTController._setXHR(mockXHR([{ status: 200, response: { status: 'ok' } }]));
410410
EventuallyQueue.poll();
411411
expect(EventuallyQueue.isPolling()).toBe(true);
412412
jest.runOnlyPendingTimers();

0 commit comments

Comments
 (0)