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:
Kendrick Chan 2018-07-19 02:04:24 +00:00
commit ffafa47a95

View file

@ -37,7 +37,10 @@ class MQTTClient
$sessions = $job_order->getCustomer()->getMobileSessions();
if (count($sessions) == 0)
{
error_log("no sessions to send mqtt event to");
return;
{
// send to every customer session
foreach ($sessions as $sess)
@ -45,6 +48,8 @@ class MQTTClient
$phone_num = $sess->getPhoneNumber();
$channel = self::PREFIX . $phone_num;
$this->publish($channel, json_encode($payload));
error_log("sent to $channel");
}
}