Skip to content

Commit

Permalink
Notifications cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jenssegers committed Apr 24, 2012
1 parent 9f08c7b commit 6a7e9fe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions application/controllers/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ public function index() {
if ($user = $this->auth->current_user()) {
$clan = $this->clan_model->get($user['clanid']);

$this->load->model('notification_model');
$notifications = $this->notification_model->get_personal($user['fsqid']);
if (!$notifications = $this->cache->get('api/notifications-' . $user['fsqid'] . '.cache')) {
$this->load->model('notification_model');
$notifications = $this->notification_model->get_personal($user['fsqid']);
$this->cache->save('api/notifications-' . $user['fsqid'] . '.cache', $notifications, 60);
}
} else {
$clan = FALSE;
$notifications = array();
Expand Down

0 comments on commit 6a7e9fe

Please sign in to comment.