public function add($args = array()) { log_message('TASK_DEBUG', __FUNCTION__ . ' > ' . 'Reviews task started'); $all_dir_users = Directory_User::get_all(); $acc = $this->getAAC(); foreach ($all_dir_users as $_dir_user) { //TODO - optimize this $user = new User($_dir_user->user_id); if (!$user->exists()) { continue; } $acc->setUser($user); if (!$acc->isGrantedPlan('reviews_monitoring')) { continue; } $args = $_dir_user->to_array(); $this->jobQueue->addJob('tasks/reviews_task/grabber', $args); } }
public function add($args = array()) { $all_dir_users = Directory_User::get_all(); $notify = true; if (isset($args['notify'])) { $notify = (bool) $args['notify']; } foreach ($all_dir_users as $_dir_user) { $args = $_dir_user->to_array(); $args['notify_status'] = $notify; try { $this->grabber($args); } catch (Exception $e) { } } }