Skip to content

Commit a39a2a0

Browse files
author
Bogdan Rancichi
committed
[fix] remove unused call; remove finally clause; made some methods private
1 parent 6046a41 commit a39a2a0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Command/BatchConsumerCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
6868

6969
pcntl_signal(SIGTERM, array(&$this, 'stopConsumer'));
7070
pcntl_signal(SIGINT, array(&$this, 'stopConsumer'));
71-
// pcntl_signal(SIGHUP, array(&$this, 'restartConsumer'));
7271
}
7372

7473
if (defined('AMQP_DEBUG') === false) {

RabbitMq/BatchConsumer.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public function batchConsume()
158158
'stacktrace' => $e->getTraceAsString()
159159
)
160160
));
161+
$this->resetBatch();
161162
throw $e;
162163
} catch (\Error $e) {
163164
$this->logger->error($e->getMessage(), array(
@@ -167,10 +168,11 @@ public function batchConsume()
167168
'stacktrace' => $e->getTraceAsString()
168169
)
169170
));
170-
throw $e;
171-
} finally {
172171
$this->resetBatch();
172+
throw $e;
173173
}
174+
175+
$this->resetBatch();
174176
}
175177

176178
/**
@@ -323,7 +325,7 @@ private function addMessage(AMQPMessage $message)
323325
*
324326
* @return AMQPMessage
325327
*/
326-
public function getMessage($deliveryTag)
328+
private function getMessage($deliveryTag)
327329
{
328330
return isset($this->messages[$deliveryTag])
329331
? $this->messages[$deliveryTag]
@@ -338,7 +340,7 @@ public function getMessage($deliveryTag)
338340
*
339341
* @throws AMQPRuntimeException
340342
*/
341-
public function getMessageChannel($deliveryTag)
343+
private function getMessageChannel($deliveryTag)
342344
{
343345
$message = $this->getMessage($deliveryTag);
344346
if (!$message) {

0 commit comments

Comments
 (0)