Database Availability Checks
Describes the checks Umbraco will do on startup to determine the availability of the database, and how this behavior can be customized.
Implementing Custom Behavior
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Infrastructure.Persistence;
public class MyDatabaseAvailabilityCheckComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.Services.AddUnique<IDatabaseAvailabilityCheck, MyDatabaseAvailabilityCheck>();
}
}
internal class MyDatabaseAvailabilityCheck : IDatabaseAvailabilityCheck
{
public bool IsDatabaseAvailable(IUmbracoDatabaseFactory databaseFactory)
{
// Provide your custom logic to check database availability, wait as required, and return true once a connection is established.
return true;
}
}
Last updated
Was this helpful?