Merge branch '159-general-fixes-and-tweaking' into 'master'
Resolve "General fixes and tweaking" Closes #159 See merge request jankstudio/resq!160
This commit is contained in:
commit
ffafa47a95
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