public static void ReadIndex(Index index, string rootPath)
        {
            index.indexFinishedPopulating = false;

            bool retry = false;

            do
            {
                try
                {
                    index.ClearAll();
                    ReadFilesCore(index, rootPath);
                    retry = false;
                    index.loadErrorMessage = null;
                }
                catch (Exception ex)
                {
                    index.loadErrorMessage = ex.ToString();
                    retry = true;
                    Thread.Sleep(10000);
                }
            }while (retry);

            index.indexFinishedPopulating = true;

            for (int i = 0; i < 10; i++)
            {
                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
            }
        }
Пример #2
0
        public static void ReadIndex(Index index, string rootPath)
        {
            index.indexFinishedPopulating = false;

            bool retry = false;
            do
            {
                try
                {
                    index.ClearAll();
                    ReadFilesCore(index, rootPath);
                    retry = false;
                    index.loadErrorMessage = null;
                }
                catch (Exception ex)
                {
                    index.loadErrorMessage = ex.ToString();
                    retry = true;
                    Thread.Sleep(10000);
                }
            }
            while (retry);

            index.indexFinishedPopulating = true;

            for (int i = 0; i < 10; i++)
            {
                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
            }
        }