Skip to content

Commit

Permalink
Merge pull request #245 from jshah4517/master
Browse files Browse the repository at this point in the history
Fix cache TTL
  • Loading branch information
kodeine committed Nov 14, 2019
2 parents 5cca6ff + d1f492d commit 31932c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Kodeine/Acl/Models/Eloquent/Role.php
Expand Up @@ -59,7 +59,7 @@ public function getPermissions()
{
return \Cache::remember(
'acl.getPermissionsInheritedById_'.$this->id,
config('acl.cacheMinutes'),
now()->addMinutes(config('acl.cacheMinutes', 1)),
function () {
return $this->getPermissionsInherited();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Kodeine/Acl/Traits/HasPermission.php
Expand Up @@ -42,7 +42,7 @@ public function getPermissions()
// user permissions overridden from role.
$permissions = \Cache::remember(
'acl.getPermissionsById_'.$this->id,
config('acl.cacheMinutes'),
now()->addMinutes(config('acl.cacheMinutes', 1)),
function () {
return $this->getPermissionsInherited();
}
Expand Down Expand Up @@ -83,7 +83,7 @@ public function hasPermission($permission, $operator = null)
// all of user role permissions
$merge = \Cache::remember(
'acl.getMergeById_'.$this->id,
config('acl.cacheMinutes'),
now()->addMinutes(config('acl.cacheMinutes', 1)),
function () {
return $this->getPermissions();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Kodeine/Acl/Traits/HasRole.php
Expand Up @@ -44,7 +44,7 @@ public function getRoles()
{
$this_roles = \Cache::remember(
'acl.getRolesById_'.$this->id,
config('acl.cacheMinutes'),
now()->addMinutes(config('acl.cacheMinutes', 1)),
function () {
return $this->roles;
}
Expand Down

0 comments on commit 31932c0

Please sign in to comment.