修改缓存
parent
7a62943121
commit
54d4f389ca
|
@ -17,6 +17,7 @@ using IRaCIS.Core.Application.Filter;
|
|||
using DocumentFormat.OpenXml.Drawing;
|
||||
using Quartz;
|
||||
using IRaCIS.Application.Services.BackGroundJob;
|
||||
using EasyCaching.Core;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -47,6 +48,7 @@ namespace IRaCIS.Application.Services
|
|||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||
private readonly IRepository<TrialDocument> _trialDocumentRepository;
|
||||
private readonly IRepository<User> _userRepository;
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly IRepository<ReadingCustomTag> _readingCustomTagRepository;
|
||||
private readonly IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository;
|
||||
private readonly IRepository<ReadingTrialCriterionDictionary> _readingTrialCriterionDictionaryRepository;
|
||||
|
@ -87,6 +89,7 @@ namespace IRaCIS.Application.Services
|
|||
IRepository<OrganInfo> organInfoRepository,
|
||||
IRepository<TrialDocument> trialDocumentRepository,
|
||||
IRepository<User> userRepository,
|
||||
IEasyCachingProvider provider,
|
||||
IRepository<ReadingCustomTag> readingCustomTagRepository,
|
||||
IMemoryCache cache,
|
||||
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
||||
|
@ -127,6 +130,7 @@ namespace IRaCIS.Application.Services
|
|||
this._organInfoRepository = organInfoRepository;
|
||||
this._trialDocumentRepository = trialDocumentRepository;
|
||||
this._userRepository = userRepository;
|
||||
this._provider = provider;
|
||||
this._readingCustomTagRepository = readingCustomTagRepository;
|
||||
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
|
||||
this._tumorAssessmentRepository = tumorAssessmentRepository;
|
||||
|
@ -2470,10 +2474,13 @@ namespace IRaCIS.Application.Services
|
|||
public async Task VerifyReadingRestTime()
|
||||
{
|
||||
var cacheKey = _userInfo.Id.ToString();
|
||||
var value = _cache.Get(cacheKey);
|
||||
|
||||
|
||||
var value = _provider.Get<string>(cacheKey).Value;
|
||||
if (value == null)
|
||||
{
|
||||
_cache.Set(cacheKey, DateTime.Now.ToString(), TimeSpan.FromHours(5));
|
||||
_provider.Set(cacheKey, DateTime.Now.ToString(), TimeSpan.FromHours(5));
|
||||
// _cache.Set(cacheKey, DateTime.Now.ToString(), TimeSpan.FromHours(5));
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -2488,7 +2495,8 @@ namespace IRaCIS.Application.Services
|
|||
else if (timespanMin > 140)
|
||||
{
|
||||
cacheDate = cacheDate.AddMinutes((Math.Floor((double)(timespanMin / 140))) * 140);
|
||||
_cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||
_provider.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||
// _cache.Set(cacheKey, cacheDate.ToString(), TimeSpan.FromHours(5));
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
|
Loading…
Reference in New Issue