Merge branch 'develop' into feature/tg-reports
This commit is contained in:
commit
3e8fecf7ba
@ -29,35 +29,35 @@ namespace ASC.Web.Files.Utils;
|
||||
[Singletone]
|
||||
public class FileMarkerCache
|
||||
{
|
||||
private readonly ICache _ñache;
|
||||
private readonly ICache _cache;
|
||||
private readonly ICacheNotify<FileMarkerCacheItem> _notify;
|
||||
private readonly TimeSpan _cacheExpiration = TimeSpan.FromMinutes(10);
|
||||
|
||||
public FileMarkerCache(ICacheNotify<FileMarkerCacheItem> notify, ICache cache)
|
||||
{
|
||||
_ñache = cache;
|
||||
_cache = cache;
|
||||
_notify = notify;
|
||||
|
||||
_notify.Subscribe((i) => _ñache.Remove(i.Key), CacheNotifyAction.Remove);
|
||||
_notify.Subscribe((i) => _cache.Remove(i.Key), CacheNotifyAction.Remove);
|
||||
}
|
||||
|
||||
public T Get<T>(string key) where T : class
|
||||
{
|
||||
return _ñache.Get<T>(key);
|
||||
return _cache.Get<T>(key);
|
||||
}
|
||||
|
||||
public void Insert(string key, object value)
|
||||
{
|
||||
_notify.Publish(new FileMarkerCacheItem { Key = key }, CacheNotifyAction.Remove);
|
||||
|
||||
_ñache.Insert(key, value, _cacheExpiration);
|
||||
_cache.Insert(key, value, _cacheExpiration);
|
||||
}
|
||||
|
||||
public void Remove(string key)
|
||||
{
|
||||
_notify.Publish(new FileMarkerCacheItem { Key = key }, CacheNotifyAction.Remove);
|
||||
|
||||
_ñache.Remove(key);
|
||||
_cache.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user