This commit is contained in:
Elijah R 2024-06-02 13:07:29 -04:00
parent c52af0def9
commit 7ed9b56a7f
2 changed files with 5 additions and 3 deletions

View file

@ -140,7 +140,8 @@ public class HTTPServer
return Results.Json(new VMInfo(VM.cvm)); return Results.Json(new VMInfo(VM.cvm));
} }
public void Run() { public Task RunAsync()
this.app.Run(); {
return this.app.RunAsync();
} }
} }

View file

@ -54,7 +54,7 @@ class Program
Utilities.Log(LogLevel.INFO, "Connected to MySQL Database."); Utilities.Log(LogLevel.INFO, "Connected to MySQL Database.");
// Start the HTTP server // Start the HTTP server
HTTP = new HTTPServer(); HTTP = new HTTPServer();
HTTP.Run(); var t = HTTP.RunAsync();
// Initialize the Discord bot // Initialize the Discord bot
Discord = new DiscordBot(Config.Discord.Token, Config.Discord.ReportChannel); Discord = new DiscordBot(Config.Discord.Token, Config.Discord.ReportChannel);
await Discord.Connect(); await Discord.Connect();
@ -66,6 +66,7 @@ class Program
vm.UsernameIncident += (_, i) => Discord.FlagUsernameAsync(i); vm.UsernameIncident += (_, i) => Discord.FlagUsernameAsync(i);
await vm.OpenAsync(); await vm.OpenAsync();
} }
await t;
} }
public static void Exit() public static void Exit()