Implemented scheduling service and first two jobs

This commit is contained in:
2026-10-28 17:01:28 +02:00
parent 6114d8f457
commit 7f686fa8c6
20 changed files with 304 additions and 112 deletions
@@ -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;