Skip to content

Commit

Permalink
Don't migrate on the CLI (#2240)
Browse files Browse the repository at this point in the history
  • Loading branch information
erri120 authored Nov 11, 2024
1 parent 5269982 commit 8a6a5bf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/NexusMods.App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ public static int Main(string[] args)
);
var services = host.Services;

// Run the migrations
var migration = services.GetRequiredService<MigrationService>();
migration.Run().Wait();
if (startupMode.RunAsMain)
{
// Run the migrations
var migration = services.GetRequiredService<MigrationService>();
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>();
cliServer?.StartCliServerAsync().Wait(timeout: TimeSpan.FromSeconds(5));
Expand Down

0 comments on commit 8a6a5bf

Please sign in to comment.