diff --git a/src/helpers/constants.js b/src/helpers/constants.js index ef86ae9..98c68b6 100644 --- a/src/helpers/constants.js +++ b/src/helpers/constants.js @@ -1,8 +1,8 @@ -const constants = { +export const jobStatuses = { JOB_STATUS_PENDING: 'pending', JOB_STATUS_PROCESSING: 'processing', JOB_STATUS_COMPLETED: 'completed', JOB_STATUS_FAILED: 'failed', }; -export default constants; +export default Object.assign({}, jobStatuses); \ No newline at end of file diff --git a/src/job.js b/src/job.js index efe2203..873fe49 100644 --- a/src/job.js +++ b/src/job.js @@ -1,7 +1,7 @@ import events from 'events'; import { isPlainObject } from 'lodash'; import logger from './helpers/logger'; -import { JOB_STATUS_PENDING } from './helpers/constants'; +import { jobStatuses } from './helpers/constants'; import createIndex from './helpers/create_index'; const debug = logger('job'); @@ -33,7 +33,7 @@ export default class Job extends events.EventEmitter { created_at: new Date(), attempts: 0, max_attempts: this.maxAttempts, - status: JOB_STATUS_PENDING, + status: jobStatuses.JOB_STATUS_PENDING, } }) .then((doc) => {