public async Task <T> GetAsync <T>(string key, VariableAttribute attr) { try { return(await _dataCache.RetrieveData <T>( key, attr.ExpirationTime > 0?(TimeSpan?)TimeSpan.FromSeconds(attr.ExpirationTime) : null)); } catch (DataExpiredException) { return(default);
public async Task <List <HistoryFeedEntry> > GetHistory(CrawlerSet set) { if (_historyDictionary.TryGetValue(set.Guid, out var history)) { return(history); } history = await _dataCache.RetrieveData <List <HistoryFeedEntry> >($"{HistoryDirectory}/{set.Guid}"); if (history != null) { _historyDictionary[set.Guid] = history; } return(history); }
public static async Task <T> RetrieveData <T>(string filename, string originFolder, int expiration) { return(await DataCacheService.RetrieveData <T>(filename, originFolder, expiration)); }