Skip to content

Commit 4258426

Browse files
authored
Merge pull request #2 from freyo/master
Request Bug Fixes
2 parents 669fafa + 0602ad4 commit 4258426

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Tencent Cloud Message Queue driver for Laravel Queue
3737
3838
CMQ_QUEUE_HOST=https://cmq-queue-region.api.qcloud.com
3939
CMQ_QUEUE=queue_name
40+
CMQ_QUEUE_POLLING_WAIT_SECONDS=30
4041
4142
CMQ_TOPIC_ENABLE=false # set to true to use topic
4243
CMQ_TOPIC_FILTER=routing # or msgtag

src/Queue/Driver/CMQClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ protected function check_status($resp_inter)
130130
}
131131

132132
$resp = json_decode($resp_inter->data, TRUE);
133+
133134
$code = $resp['code'];
134135
$message = $resp['message'];
135-
$requestId = $resp['requestId'];
136+
$requestId = isset($resp['requestId']) ? $resp['requestId'] : null;
136137

137138
if ($code != 0) {
138139
throw new CMQServerException($message, $requestId, $code, $resp);

src/Queue/Driver/Queue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public function receive_message($polling_wait_seconds = NULL)
248248
{
249249

250250
$params = array('queueName' => $this->queue_name);
251-
if ($polling_wait_seconds != NULL) {
251+
if ($polling_wait_seconds !== NULL) {
252252
$params['UserpollingWaitSeconds'] = $polling_wait_seconds;
253253
$params['pollingWaitSeconds'] = $polling_wait_seconds;
254254
} else {

0 commit comments

Comments
 (0)