Add debug data for mqtt sending to user app #159
This commit is contained in:
parent
b586f6486d
commit
2a1f0977c7
1 changed files with 5 additions and 0 deletions
|
|
@ -37,7 +37,10 @@ class MQTTClient
|
||||||
|
|
||||||
$sessions = $job_order->getCustomer()->getMobileSessions();
|
$sessions = $job_order->getCustomer()->getMobileSessions();
|
||||||
if (count($sessions) == 0)
|
if (count($sessions) == 0)
|
||||||
|
{
|
||||||
|
error_log("no sessions to send mqtt event to");
|
||||||
return;
|
return;
|
||||||
|
{
|
||||||
|
|
||||||
// send to every customer session
|
// send to every customer session
|
||||||
foreach ($sessions as $sess)
|
foreach ($sessions as $sess)
|
||||||
|
|
@ -45,6 +48,8 @@ class MQTTClient
|
||||||
$phone_num = $sess->getPhoneNumber();
|
$phone_num = $sess->getPhoneNumber();
|
||||||
$channel = self::PREFIX . $phone_num;
|
$channel = self::PREFIX . $phone_num;
|
||||||
$this->publish($channel, json_encode($payload));
|
$this->publish($channel, json_encode($payload));
|
||||||
|
|
||||||
|
error_log("sent to $channel");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue