refactor: 角色服务增加缓存
This commit is contained in:
parent
919f543cbd
commit
a987e8eda3
|
@ -17,10 +17,6 @@ class RoleService : IRole
|
|||
|
||||
private const string RoleServiceGetRolesByGroupIdCacheKey = "RoleService-GetRolesByGroupId";
|
||||
|
||||
private CancellationTokenSource? GetRolesByUserIdCancellationTokenSource { get; set; }
|
||||
|
||||
private CancellationTokenSource? GetRolesByGroupIdCancellationTokenSource { get; set; }
|
||||
|
||||
private IDatabase Database { get; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -64,6 +60,10 @@ class RoleService : IRole
|
|||
Database.AbortTransaction();
|
||||
throw;
|
||||
}
|
||||
if(ret)
|
||||
{
|
||||
CacheManager.Clear();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,10 @@ class RoleService : IRole
|
|||
Database.AbortTransaction();
|
||||
throw;
|
||||
}
|
||||
if (ret)
|
||||
{
|
||||
CacheManager.Clear();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue