From a46d8621cc93a72b2efb90ec509fade7f4ed7492 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Mon, 25 Apr 2016 14:21:28 -0700 Subject: [PATCH] make constants more explicitly accessible --- src/helpers/constants.js | 4 ++-- src/job.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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) => {