Skip to content

Commit

Permalink
renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
podviaznikov committed Sep 29, 2016
1 parent fd2b2cd commit 82e9694
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/rabbitmq.js
Expand Up @@ -686,7 +686,7 @@ class RabbitMQ {
timestamp: Date.now(),
headers: {}
}
jobMeta.headers.previousEvent = RabbitMQ.getKeyFromClsNamespace('currentWorkerName')
jobMeta.headers.publisherWorkerName = RabbitMQ.getKeyFromClsNamespace('currentWorkerName')
return jobMeta
}
/**
Expand Down
2 changes: 1 addition & 1 deletion test/functional/basic.js
Expand Up @@ -57,7 +57,7 @@ describe('Basic Example', () => {

it('should trigger series of events', (done) => {
testWorkerTwoEmitter.on('task', function (job, jobMeta) {
assert.equal(jobMeta.headers.previousEvent, testQueueOne)
assert.equal(jobMeta.headers.publisherWorkerName, testQueueOne)
assert.equal(job.message, 'hello world2')
done()
})
Expand Down
6 changes: 3 additions & 3 deletions test/unit/rabbitmq.js
Expand Up @@ -773,15 +773,15 @@ describe('rabbitmq', () => {
ns.run(() => {
ns.set('currentWorkerName', testEvent)
const jobMeta = RabbitMQ.buildJobMeta('api')
assert.isString(jobMeta.headers.previousEvent, testEvent)
assert.isString(jobMeta.headers.publisherWorkerName, testEvent)
cb()
})
})
})

it('should not set previousEvent if namespace does not exist', () => {
it('should not set publisherWorkerName if namespace does not exist', () => {
const jobMeta = RabbitMQ.buildJobMeta('api')
assert.isUndefined(jobMeta.headers.previousEvent)
assert.isUndefined(jobMeta.headers.publisherWorkerName)
})
})

Expand Down

0 comments on commit 82e9694

Please sign in to comment.