|
|
@ -147,6 +147,7 @@ namespace FLocal.ImportConsole { |
|
|
|
private readonly static DateTime UNIX = new DateTime(1970, 1, 1, 0, 0, 0); |
|
|
|
private readonly static DateTime UNIX = new DateTime(1970, 1, 1, 0, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
public static void processDB(string filename) { |
|
|
|
public static void processDB(string filename) { |
|
|
|
|
|
|
|
try { |
|
|
|
Dictionary<int, Action> inserts = new Dictionary<int, Action>(); |
|
|
|
Dictionary<int, Action> inserts = new Dictionary<int, Action>(); |
|
|
|
HashSet<int> discussionsIds = new HashSet<int>(); |
|
|
|
HashSet<int> discussionsIds = new HashSet<int>(); |
|
|
|
using(StreamReader reader = new StreamReader(filename)) { |
|
|
|
using(StreamReader reader = new StreamReader(filename)) { |
|
|
@ -278,14 +279,6 @@ namespace FLocal.ImportConsole { |
|
|
|
// Console.ReadLine(); |
|
|
|
// Console.ReadLine(); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
j++; |
|
|
|
j++; |
|
|
|
if((j%50000)==0) { |
|
|
|
|
|
|
|
Core.RegistryCleaner.CleanRegistry<int, Post>(); |
|
|
|
|
|
|
|
Core.RegistryCleaner.CleanRegistry<int, Thread>(); |
|
|
|
|
|
|
|
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)) { |
|
|
|
foreach(int discussionId in discussionsIds.OrderBy(id => id)) { |
|
|
|
Console.WriteLine(discussionId); |
|
|
|
Console.WriteLine(discussionId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch(Exception e) { |
|
|
|
|
|
|
|
Console.Error.WriteLine(e.GetType().FullName + ": " + e.Message); |
|
|
|
|
|
|
|
Console.Error.WriteLine(e.StackTrace); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|