Implemented scheduling service and first two jobs
This commit is contained in:
@@ -24,7 +24,7 @@ public sealed class ExecutionCacheService(ExecutionService service, IDistributed
|
||||
public async Task<Result<Disbursement>> GetDisbursementAsync(string disbursementIdHash, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result<Disbursement>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetDisbursementAsync(disbursementIdHash, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getdisbursement-{disbursementIdHash}").Value;
|
||||
@@ -48,7 +48,7 @@ public sealed class ExecutionCacheService(ExecutionService service, IDistributed
|
||||
public async Task<Result<Disbursement[]>> GetDisbursementsAsync(Pagination pagination, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result<Disbursement[]>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetDisbursementsAsync(pagination, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getdisbursements-{pagination.Page}-{pagination.PageSize}-{pagination.Index}").Value;
|
||||
@@ -72,7 +72,7 @@ public sealed class ExecutionCacheService(ExecutionService service, IDistributed
|
||||
public async Task<Result<Risk>> GetRiskAsync(string riskIdHash, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result<Risk>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetRiskAsync(riskIdHash, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getrisk-{riskIdHash}").Value;
|
||||
@@ -96,7 +96,7 @@ public sealed class ExecutionCacheService(ExecutionService service, IDistributed
|
||||
public async Task<Result<Risk[]>> GetRisksAsync(Pagination pagination, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result<Risk[]>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetRisksAsync(pagination, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getrisks-{pagination.Page}-{pagination.PageSize}-{pagination.Index}").Value;
|
||||
@@ -120,7 +120,7 @@ public sealed class ExecutionCacheService(ExecutionService service, IDistributed
|
||||
public async Task<Result<Rule>> GetRuleAsync(string ruleIdHash, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result<Rule>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetRuleAsync(ruleIdHash, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getrisk-{ruleIdHash}").Value;
|
||||
@@ -144,7 +144,7 @@ public sealed class ExecutionCacheService(ExecutionService service, IDistributed
|
||||
public async Task<Result<Rule[]>> GetRulesAsync(Pagination pagination, CancellationToken cancellationToken = default) =>
|
||||
await Result.Try((Func<Task<Result<Rule[]>>>)(async () =>
|
||||
{
|
||||
if (!await featureManager.IsEnabledAsync(ServiceCachingFeature))
|
||||
if (!await featureManager.IsEnabledAsync(FeatureServiceCaching))
|
||||
return await service.GetRulesAsync(pagination, cancellationToken);
|
||||
|
||||
var cacheKey = HashService.ToMd5Hash($"getrules-{pagination.Page}-{pagination.PageSize}-{pagination.Index}").Value;
|
||||
|
||||
Reference in New Issue
Block a user