From 8a6a5bf50e0050282decfd327def647168de71a5 Mon Sep 17 00:00:00 2001 From: erri120 Date: Mon, 11 Nov 2024 18:21:16 +0100 Subject: [PATCH] Don't migrate on the CLI (#2240) --- src/NexusMods.App/Program.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/NexusMods.App/Program.cs b/src/NexusMods.App/Program.cs index fbd26d4e14..249367096d 100644 --- a/src/NexusMods.App/Program.cs +++ b/src/NexusMods.App/Program.cs @@ -60,15 +60,16 @@ public static int Main(string[] args) ); var services = host.Services; - // Run the migrations - var migration = services.GetRequiredService(); - migration.Run().Wait(); + if (startupMode.RunAsMain) + { + // Run the migrations + var migration = services.GetRequiredService(); + migration.Run().Wait(); + } - // Okay to do wait here, as we are in the main process thread. host.StartAsync().Wait(timeout: TimeSpan.FromMinutes(5)); - - + // Start the CLI server if we are the main process. var cliServer = services.GetService(); cliServer?.StartCliServerAsync().Wait(timeout: TimeSpan.FromSeconds(5));