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
|
public class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
var logger = LogManager.GetCurrentClassLogger();
|
var logger = LogManager.GetCurrentClassLogger();
|
||||||
logger.Info("Opening up DB to perform a migration (if one is needed)");
|
logger.Info("Opening up DB to perform a migration (if one is needed)");
|
||||||
using var db = new ApplicationDbContext();
|
await using var db = new ApplicationDbContext();
|
||||||
db.Database.Migrate();
|
await db.Database.MigrateAsync();
|
||||||
logger.Info("Migration done. Syncing builtin settings keys");
|
logger.Info("Migration done. Syncing builtin settings keys");
|
||||||
BuiltIn.SyncSettingsWithDb().Wait();
|
await BuiltIn.SyncSettingsWithDb();
|
||||||
logger.Info("Migrating settings from config.json (if needed)");
|
logger.Info("Migrating settings from config.json (if needed)");
|
||||||
BuiltIn.MigrateJsonSettingsToDb().Wait();
|
await BuiltIn.MigrateJsonSettingsToDb();
|
||||||
logger.Info("Handing over to bot now");
|
logger.Info("Handing over to bot now");
|
||||||
Console.OutputEncoding = Encoding.UTF8;
|
Console.OutputEncoding = Encoding.UTF8;
|
||||||
new ChatBot();
|
new ChatBot();
|
||||||
|
|||||||
Reference in New Issue
Block a user