mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Converted to async main method
This commit is contained in:
@@ -7,16 +7,16 @@ namespace KfChatDotNetBot
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
static async Task Main(string[] args)
|
||||
{
|
||||
var logger = LogManager.GetCurrentClassLogger();
|
||||
logger.Info("Opening up DB to perform a migration (if one is needed)");
|
||||
using var db = new ApplicationDbContext();
|
||||
db.Database.Migrate();
|
||||
await using var db = new ApplicationDbContext();
|
||||
await db.Database.MigrateAsync();
|
||||
logger.Info("Migration done. Syncing builtin settings keys");
|
||||
BuiltIn.SyncSettingsWithDb().Wait();
|
||||
await BuiltIn.SyncSettingsWithDb();
|
||||
logger.Info("Migrating settings from config.json (if needed)");
|
||||
BuiltIn.MigrateJsonSettingsToDb().Wait();
|
||||
await BuiltIn.MigrateJsonSettingsToDb();
|
||||
logger.Info("Handing over to bot now");
|
||||
Console.OutputEncoding = Encoding.UTF8;
|
||||
new ChatBot();
|
||||
|
||||
Reference in New Issue
Block a user