Fixing issue with notification cron
* Updated getAllActive to search by type
This commit is contained in:
parent
3bc5c68403
commit
6eeff19ff5
@ -38,7 +38,7 @@ if (empty($aWorkers)) {
|
||||
}
|
||||
|
||||
// We notified, lets check which recovered
|
||||
$aNotifications = $notification->getAllActive();
|
||||
$aNotifications = $notification->getAllActive('idle_worker');
|
||||
if (!empty($aNotifications)) {
|
||||
foreach ($aNotifications as $aNotification) {
|
||||
$aData = json_decode($aNotification['data'], true);
|
||||
|
||||
@ -50,10 +50,10 @@ class Notification extends Mail {
|
||||
/**
|
||||
* Get all active notifications
|
||||
**/
|
||||
public function getAllActive() {
|
||||
public function getAllActive($strType) {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
$stmt =$this->mysqli->prepare("SELECT id, data FROM $this->table WHERE active = 1 LIMIT 1");
|
||||
if ($stmt && $stmt->execute() && $result = $stmt->get_result())
|
||||
$stmt =$this->mysqli->prepare("SELECT id, data FROM $this->table WHERE active = 1 AND type = ?");
|
||||
if ($stmt && $stmt->bind_param('s', $strType) && $stmt->execute() && $result = $stmt->get_result())
|
||||
return $result->fetch_all(MYSQLI_ASSOC);
|
||||
// Catchall
|
||||
return false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user