From 520a2de8c72b42e1eb7e333cfa64f3374a05239f Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Tue, 6 Jul 2010 21:19:31 +0000 Subject: [PATCH] Some bugs fixed in ShallerDBProcessor --- ImportConsole/ShallerDBProcessor.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ImportConsole/ShallerDBProcessor.cs b/ImportConsole/ShallerDBProcessor.cs index c4f7709..c434de2 100644 --- a/ImportConsole/ShallerDBProcessor.cs +++ b/ImportConsole/ShallerDBProcessor.cs @@ -147,6 +147,7 @@ namespace FLocal.ImportConsole { private readonly static DateTime UNIX = new DateTime(1970, 1, 1, 0, 0, 0); public static void processDB(string filename) { + try { Dictionary inserts = new Dictionary(); HashSet discussionsIds = new HashSet(); using(StreamReader reader = new StreamReader(filename)) { @@ -278,14 +279,6 @@ namespace FLocal.ImportConsole { // Console.ReadLine(); } finally { j++; - if((j%50000)==0) { - Core.RegistryCleaner.CleanRegistry(); - Core.RegistryCleaner.CleanRegistry(); - GC.Collect(); - Console.Error.WriteLine(); - Console.Error.WriteLine("Registry cleaned; garbage collected"); - Console.Error.WriteLine(); - } } } @@ -293,6 +286,10 @@ namespace FLocal.ImportConsole { foreach(int discussionId in discussionsIds.OrderBy(id => id)) { Console.WriteLine(discussionId); } + } catch(Exception e) { + Console.Error.WriteLine(e.GetType().FullName + ": " + e.Message); + Console.Error.WriteLine(e.StackTrace); + } }