Implemented scheduling service and first two jobs
This commit is contained in:
@@ -29,7 +29,7 @@ public sealed class UserCacheService(UserService service, IDistributedCache cach
|
||||
public async Task<Result<Claim[]>> GetRoleClaimsAsync(Guid roleId, Guid userId, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result<Claim[]>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetRoleClaimsAsync(roleId, userId, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getsystemroles-{userId}").Value;
|
||||
@@ -54,7 +54,7 @@ public sealed class UserCacheService(UserService service, IDistributedCache cach
|
||||
public async Task<Result<Role[]>> GetSystemRolesAsync(Guid userId, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result<Role[]>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetSystemRolesAsync(userId, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getsystemroles-{userId}").Value;
|
||||
@@ -79,7 +79,7 @@ public sealed class UserCacheService(UserService service, IDistributedCache cach
|
||||
public async Task<Result<User>> GetUserAsync(Guid userId, CancellationToken cancellationToken) =>
|
||||
await Result.Try((Func<Task<Result<User>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetUserAsync(userId, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getuser-{userId}").Value;
|
||||
@@ -103,7 +103,7 @@ public sealed class UserCacheService(UserService service, IDistributedCache cach
|
||||
public async Task<Result<Claim[]>> GetUserClaimsAsync(Guid targetUserId, Guid userId, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result<Claim[]>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetUserClaimsAsync(targetUserId, userId, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getuserclaims-{userId}").Value;
|
||||
@@ -128,7 +128,7 @@ public sealed class UserCacheService(UserService service, IDistributedCache cach
|
||||
public async Task<Result<Role[]>> GetUserRolesAsync(Guid targetUserId, Guid userId, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result<Role[]>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetUserRolesAsync(targetUserId, userId, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getuserroles-{userId}").Value;
|
||||
|
||||
Reference in New Issue
Block a user