You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am working on a .NET 6 project that includes a background service. I have configured the migration in the startup as shown below. However, I have a problem: the background service tries to access the database before it is ready. This happens when the migration takes longer than usual to set up MongoDB. How can I ensure that the background service waits for the migration to finish before performing any database operations?
Hello, I am working on a .NET 6 project that includes a background service. I have configured the migration in the startup as shown below. However, I have a problem: the background service tries to access the database before it is ready. This happens when the migration takes longer than usual to set up MongoDB. How can I ensure that the background service waits for the migration to finish before performing any database operations?
services
.AddMigration(new MongoMigrationSettings
{
Database = "blabla",
ConnectionString = config.GetConnectionString("MongoDb"),
DatabaseMigrationVersion = new DocumentVersion(1, 0, 0)
});
The text was updated successfully, but these errors were encountered: