Пример #1
0
        public async Task <long> GetBlockHeight()
        {
            const string key = "BlockHeight";

            if (!_memoryCache.TryGetValue(key, out long blockHeight))
            {
                blockHeight = await _blockService.GetBlockHeight();

                CacheItemKeys.Keys.Add(key);
                _memoryCache.Set(key, blockHeight);
            }

            return(blockHeight);
        }