Skip to content

Commit

Permalink
Merge branch 'expose-mongo-transactions' of https://github.com/hahn-k…
Browse files Browse the repository at this point in the history
…ev/TheCombine into expose-mongo-transactions
  • Loading branch information
imnasnainaec committed Oct 1, 2024
2 parents 58a7833 + dd7a351 commit d35f61f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Backend/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApp

// If an admin user has been created via the command line, treat that as a single action and shut the
// server down so the calling script knows it's been completed successfully or unsuccessfully.
var userRepo = app.ApplicationServices.GetService<IUserRepository>();
using var startupScope = app.ApplicationServices.CreateAsyncScope();
var userRepo = startupScope.ServiceProvider.GetService<IUserRepository>();
if (userRepo is not null && CreateAdminUser(userRepo))
{
_logger.LogInformation("Stopping application");
Expand Down

0 comments on commit d35f61f

Please sign in to comment.