Пример #1
0
        public void RunIdleOperations()
        {
            bool tryEnter = Monitor.TryEnter(idleLocker);

            try
            {
                if (tryEnter == false)
                {
                    return;
                }

                TransportState.OnIdle();
                IndexStorage.RunIdleOperations();
                Tasks.ClearCompletedPendingTasks();
            }
            finally
            {
                if (tryEnter)
                {
                    Monitor.Exit(idleLocker);
                }
            }
        }
Пример #2
0
        public void RunIdleOperations()
        {
            bool tryEnter = Monitor.TryEnter(idleLocker);

            try
            {
                if (tryEnter == false)
                {
                    return;
                }
                WorkContext.LastIdleTime = SystemTime.UtcNow;
                TransportState.OnIdle();
                IndexStorage.RunIdleOperations();
                IndexReplacer.ReplaceIndexes(IndexDefinitionStorage.Indexes);
                Tasks.ClearCompletedPendingTasks();
            }
            finally
            {
                if (tryEnter)
                {
                    Monitor.Exit(idleLocker);
                }
            }
        }