public List <TransactionRecordModel> GetListLatest(int total) { var list = _transactionRepository.ListLatest(total); RedisCacheHelper.TrySetCache(ConfigDataKey.LatestTransactionListCacheKey, list); return(list); }
public async Task <ProducersModel> GetListProducers() { var model = await _blockInfoRepository.ListProducers(); RedisCacheHelper.TrySetCache(ConfigDataKey.LatestProducerListCacheKey, model); return(model); }
public async Task <BlockListModel> GetListLatest() { var model = await _blockInfoRepository.ListLatest(ConfigDataKey.BlockInfoListLatestTotal); RedisCacheHelper.TrySetCache(ConfigDataKey.LatestBlockListCacheKey, model); return(model); }
public List <TokenAccountModel> GetAccountsOfToken(string code, decimal symbolCode) { var cacheKey = GetTokenAccountsCacheKey(code, symbolCode); var list = _contractRepository.GetTokenAccounts(code, symbolCode); if (list != null && list.Any()) { RedisCacheHelper.TrySetCache(cacheKey, list, TimeSpan.FromSeconds(ConfigDataKey.TokenAccountsListCacheExpired)); } return(list); }
public HomeStatisticalModel GetLatestStatistical() { var model = new HomeStatisticalModel(); model.Tps = _blockInfoRepository.GetTps(); var total = _transactionRepository.GetTotal(); model.TransactionTotal = total; var lastBlock = _blockInfoRepository.GetLastBlock(); model.BlockNum = lastBlock.BlockNum; model.Node = lastBlock.Producer; RedisCacheHelper.TrySetCache(ConfigDataKey.LatestBlockCacheKey, model); return(model); }
protected bool TrySetCache(string key, object data, TimeSpan?expiredTime = null) { return(RedisCacheHelper.TrySetCache(key, data, expiredTime)); }