public async Task <int> Size(string channel, string key = null) { var specificSize = await _cache.Size(channel, key).ConfigureAwait(false); var specificKey = new Tuple <string, string>(channel, key); if (_uncommitted.ContainsKey(specificKey)) { specificSize += _uncommitted[specificKey].Count; } return(specificSize); }
public async Task <int> Size(string channel, string key = null) { Logger.Write(LogLevel.Debug, () => $"Getting size of delayed channel [{channel}] key [{key}]"); var specificSize = await _cache.Size(channel, key).ConfigureAwait(false); var specificKey = new Tuple <string, string>(channel, key); if (_uncommitted.ContainsKey(specificKey)) { specificSize += _uncommitted[specificKey].Count; } if (specificSize > 5000) { SlowLogger.Write(LogLevel.Info, () => $"Delayed channel [{channel}] specific [{key}] size is {specificSize}!"); } return(specificSize); }