Exemple #1
0
        private void FlushByInterval(Statement statement)
        {
            String   fullSqlId     = statement.FullSqlId;
            DateTime lastFlushTime = DateTime.Now;

            if (!MappedLastFlushTimes.ContainsKey(fullSqlId))
            {
                MappedLastFlushTimes[fullSqlId] = lastFlushTime;
            }
            else
            {
                lastFlushTime = MappedLastFlushTimes[fullSqlId];
            }
            var lastInterval = DateTime.Now - lastFlushTime;

            if (lastInterval >= statement.Cache.FlushInterval.Interval)
            {
                Flush(statement, lastInterval);
            }
        }
Exemple #2
0
        public void FlushByInterval(Statement statement)
        {
            if (statement.Cache.FlushInterval.Interval.Ticks == 0)
            {
                return;
            }
            String   FullSqlId     = statement.FullSqlId;
            DateTime LastFlushTime = DateTime.Now;

            if (!MappedLastFlushTimes.ContainsKey(FullSqlId))
            {
                MappedLastFlushTimes[FullSqlId] = LastFlushTime;
            }
            else
            {
                LastFlushTime = MappedLastFlushTimes[FullSqlId];
            }
            var lastInterval = DateTime.Now - LastFlushTime;

            if (lastInterval >= statement.Cache.FlushInterval.Interval)
            {
                Flush(statement, lastInterval);
            }
        }