From f2ed0dfbeac41cb9165cd7c25f798668d051330b Mon Sep 17 00:00:00 2001 From: Elepover Date: Mon, 27 Apr 2020 12:51:59 +0800 Subject: [PATCH] fix await --- FILE_STRUCTURE.md | 2 -- pmcenter/BotCommands/ResetConfCommand.cs | 2 +- pmcenter/BotCommands/RestartCommand.cs | 2 +- pmcenter/BotCommands/UpdateCommand.cs | 2 +- pmcenter/{ => CommandLines}/CommandLineProcess.cs | 0 pmcenter/{ => CommandLines}/CommandLineRouter.cs | 0 6 files changed, 3 insertions(+), 5 deletions(-) rename pmcenter/{ => CommandLines}/CommandLineProcess.cs (100%) rename pmcenter/{ => CommandLines}/CommandLineRouter.cs (100%) diff --git a/FILE_STRUCTURE.md b/FILE_STRUCTURE.md index deb976f..4659fab 100644 --- a/FILE_STRUCTURE.md +++ b/FILE_STRUCTURE.md @@ -33,8 +33,6 @@ File structure of pmcenter's source code: | |- UpdateHelper - pmcenter updates helper | | |- ... | |- ... - |- CommandLineProcess.cs - Loading commandlines to memory - |- CommandLineRouter.cs - Commandlines' router |- Program.cs - Main entry of pmcenter |- Setup.cs - Setup wizard's processing logic |- Template.cs - As its name diff --git a/pmcenter/BotCommands/ResetConfCommand.cs b/pmcenter/BotCommands/ResetConfCommand.cs index f48cdf6..f668342 100644 --- a/pmcenter/BotCommands/ResetConfCommand.cs +++ b/pmcenter/BotCommands/ResetConfCommand.cs @@ -40,7 +40,7 @@ public async Task ExecuteAsync(TelegramBotClient botClient, Update update) false, Vars.CurrentConf.DisableNotifications, update.Message.MessageId).ConfigureAwait(false); - Methods.ExitApp(0); + await Methods.ExitApp(0); return true; } else diff --git a/pmcenter/BotCommands/RestartCommand.cs b/pmcenter/BotCommands/RestartCommand.cs index 3b8793b..3005a3c 100644 --- a/pmcenter/BotCommands/RestartCommand.cs +++ b/pmcenter/BotCommands/RestartCommand.cs @@ -22,7 +22,7 @@ public async Task ExecuteAsync(TelegramBotClient botClient, Update update) Vars.CurrentConf.DisableNotifications, update.Message.MessageId).ConfigureAwait(false); Thread.Sleep(5000); - Methods.ExitApp(0); + await Methods.ExitApp(0); return true; } } diff --git a/pmcenter/BotCommands/UpdateCommand.cs b/pmcenter/BotCommands/UpdateCommand.cs index e629a99..357c2db 100644 --- a/pmcenter/BotCommands/UpdateCommand.cs +++ b/pmcenter/BotCommands/UpdateCommand.cs @@ -55,7 +55,7 @@ public async Task ExecuteAsync(TelegramBotClient botClient, Telegram.Bot.T Vars.CurrentConf.DisableNotifications, update.Message.MessageId).ConfigureAwait(false); Log("Exiting program... (Let the daemon do the restart job)", "BOT"); - ExitApp(0); + await ExitApp(0); return true; // end of difference } diff --git a/pmcenter/CommandLineProcess.cs b/pmcenter/CommandLines/CommandLineProcess.cs similarity index 100% rename from pmcenter/CommandLineProcess.cs rename to pmcenter/CommandLines/CommandLineProcess.cs diff --git a/pmcenter/CommandLineRouter.cs b/pmcenter/CommandLines/CommandLineRouter.cs similarity index 100% rename from pmcenter/CommandLineRouter.cs rename to pmcenter/CommandLines/CommandLineRouter.cs