Make main async

This commit is contained in:
runebaas 2020-07-15 03:11:36 +02:00
parent efed2f7120
commit 5e9cb8a4c1
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -44,7 +44,7 @@ namespace Geekbot.net
private IReactionListener _reactionListener; private IReactionListener _reactionListener;
private IGuildSettingsManager _guildSettingsManager; private IGuildSettingsManager _guildSettingsManager;
private static void Main(string[] args) private static async Task Main(string[] args)
{ {
RunParameters runParameters = null; RunParameters runParameters = null;
Parser.Default.ParseArguments<RunParameters>(args) Parser.Default.ParseArguments<RunParameters>(args)
@ -63,7 +63,7 @@ namespace Geekbot.net
logger.Information(LogSource.Geekbot, "Starting..."); logger.Information(LogSource.Geekbot, "Starting...");
try try
{ {
new Program().MainAsync(runParameters, logger).GetAwaiter().GetResult(); await new Program().Start(runParameters, logger);
} }
catch (Exception e) catch (Exception e)
{ {
@ -71,7 +71,7 @@ namespace Geekbot.net
} }
} }
private async Task MainAsync(RunParameters runParameters, GeekbotLogger logger) private async Task Start(RunParameters runParameters, GeekbotLogger logger)
{ {
_logger = logger; _logger = logger;
_runParameters = runParameters; _runParameters = runParameters;