From 871b59adae2e5b8e4167d1cf78c039bdcd5d5141 Mon Sep 17 00:00:00 2001 From: Runebaas Date: Sun, 23 Apr 2017 20:09:48 +0200 Subject: [PATCH] removing BootTasks file --- Geekbot.net/Lib/BootTasks.cs | 40 ------------------------------------ Geekbot.net/Program.cs | 8 +------- 2 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 Geekbot.net/Lib/BootTasks.cs diff --git a/Geekbot.net/Lib/BootTasks.cs b/Geekbot.net/Lib/BootTasks.cs deleted file mode 100644 index 1edca04..0000000 --- a/Geekbot.net/Lib/BootTasks.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Runtime.Serialization.Json; -using System.Threading.Tasks; -using Geekbot.net.Modules; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Geekbot.net.Lib -{ - public class BootTasks - { - public static async Task CheckSettingsFile() - { - // ToDO: Check settings file, if invalid, reconfig it -// Console.WriteLine(Path.GetFullPath("./settings.json")); - } - - public static void ParseOldDatabase(string path) - { - Console.WriteLine("Starting Database Conversion..."); - path = Path.GetFullPath(path); - Console.WriteLine($"Old db location: {path}"); - var redis = new RedisClient().Client; - Console.WriteLine("Connected to Redis..."); - var allfiles = Directory.GetFiles(path, "*.json", SearchOption.AllDirectories); - foreach ( var file in allfiles) - { - var info = new FileInfo(file); - if (info.Name.StartsWith("-")) continue; - Console.WriteLine(info.FullName); - dynamic json = JObject.Parse(File.ReadAllText(file)); - var key = info.Name.Substring(0, info.Name.Length - 5) + "-messages"; - Console.WriteLine($"{key} - {json.messages}"); - redis.StringSet(key, json.messages.ToString()); - } - } - } -} \ No newline at end of file diff --git a/Geekbot.net/Program.cs b/Geekbot.net/Program.cs index 61b80a5..b2a78c1 100755 --- a/Geekbot.net/Program.cs +++ b/Geekbot.net/Program.cs @@ -26,12 +26,6 @@ namespace Geekbot.net Console.WriteLine("========================================="); Console.WriteLine("Starting..."); - //Task.WaitAll(BootTasks.CheckSettingsFile()); - if (args.Length == 2 && args[0] == "--parse-db") - { - BootTasks.ParseOldDatabase(args[1]); - Environment.Exit(1); - } Task.WaitAll(new Program().MainAsync()); } @@ -143,4 +137,4 @@ namespace Geekbot.net } } } -} \ No newline at end of file +}