From 91730d6b8c4c5889ad8d0b32b8d3ead614e5a4ff Mon Sep 17 00:00:00 2001 From: Archi Date: Thu, 29 Dec 2022 23:53:35 +0100 Subject: [PATCH] Flush on failed shutdown sequence --- ArchiSteamFarm/Program.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index cbf84adf9..7385f8aa5 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -451,6 +451,11 @@ internal static class Program { private static async Task InitShutdownSequence() { if (ShutdownSequenceInitialized) { + // We've already initialized shutdown sequence before, we won't allow the caller to init shutdown sequence again + // While normally this will be respected, caller might not have any say in this for example because it's the runtime terminating ASF due to fatal exception + // Because of that, the least we can still do, is to ensure that exception is written to any logs on our "best effort" basis + LogManager.Flush(); + return false; }