Skip to content

Commit

Permalink
Merge pull request #64 from chadicus/master
Browse files Browse the repository at this point in the history
Include machineName in message document
  • Loading branch information
jncarver authored Jul 31, 2020
2 parents 08e6d6a + 0218e48 commit ea79f3d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ before_script:
- yes '' | pecl install -f mongodb
- composer update $PREFER_LOWEST
script: ./vendor/bin/phpunit --coverage-clover clover.xml
after_success: ./vendor/bin/coveralls -v
after_success: ./vendor/bin/php-coveralls -v
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
},
"require": {
"php": "^7.0",
"mongodb/mongodb": "^1.1"
"ext-mongodb": "*",
"mongodb/mongodb": "^1.1"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^6.5.2",
"php-coveralls/php-coveralls": "^1.0",
"squizlabs/php_codesniffer": "^3.2"
},
"autoload": {
Expand Down
2 changes: 2 additions & 0 deletions src/AbstractQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ final public function requeue(Message $message)
'payload' => $message->getPayload(),
'earliestGet' => $message->getEarliestGet(),
'priority' => $message->getPriority(),
'machineName' => gethostname(),
'created' => new UTCDateTime(),
];

Expand All @@ -246,6 +247,7 @@ final public function send(Message $message)
'payload' => $message->getPayload(),
'earliestGet' => $message->getEarliestGet(),
'priority' => $message->getPriority(),
'machineName' => gethostname(),
'created' => new UTCDateTime(),
];

Expand Down
1 change: 1 addition & 0 deletions tests/QueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ private function assertSingleMessage(Message $expected)
$this->assertSame((string)$expected->getId(), (string)$actual['_id']);
$this->assertSame($expected->getPayload(), $actual['payload']);
$this->assertSame($expected->getPriority(), $actual['priority']);
$this->assertSame(gethostname(), $actual['machineName']);
$this->assertEquals($expected->getEarliestGet(), $actual['earliestGet']);
}

Expand Down

0 comments on commit ea79f3d

Please sign in to comment.