Esempio n. 1
0
        public Task ProcessCandlesAsync(IReadOnlyList <ICandle> candles)
        {
            if (!candles.Any())
            {
                return(Task.CompletedTask);
            }

            var cacheTask = _candlesCacheService.CacheAsync(candles);

            foreach (var candle in candles)
            {
                _candlesPersistenceQueue.EnqueueCandle(candle);
            }

            return(cacheTask);
        }
Esempio n. 2
0
        public Task ProcessCandlesAsync(IReadOnlyList <ICandle> candles)
        {
            if (!candles.Any())
            {
                return(Task.CompletedTask);
            }

            var cacheTask = _candlesCacheService.CacheAsync(candles.Where(x => Constants.RedisIntervals.Contains(x.TimeInterval)).ToArray());

            foreach (var candle in candles.Where(x => Constants.DbStoredIntervals.Contains(x.TimeInterval)))
            {
                _candlesPersistenceQueue.EnqueueCandle(candle);
            }

            return(cacheTask);
        }