missing indices need to return an array

This commit is contained in:
2016-05-13 14:56:50 -07:00
parent ef61a33a38
commit 868c808db7

View File

@@ -180,7 +180,7 @@ export default class Job extends events.EventEmitter {
}
_claimPendingJobs(jobs) {
if (jobs.length === 0) return;
if (!jobs || jobs.length === 0) return;
this._stopJobPolling();
let claimed = false;
@@ -268,7 +268,7 @@ export default class Job extends events.EventEmitter {
})
.catch((err) => {
// ignore missing indices errors
if (err.status === 404) return;
if (err.status === 404) return [];
this.debug('job querying failed', err);
this.emit('error', err);